assert (terminal_name != NULL);
- fd = open (terminal_name, O_RDWR);
+ fd = open (terminal_name, O_RDWR | O_NOCTTY);
if (fd < 0)
return false;
assert (session != NULL);
assert (session->console_is_redirected);
- fd = open ("/dev/console", O_RDWR);
-
- ioctl (fd, TIOCCONS);
+ fd = open ("/dev/console", O_RDWR | O_NOCTTY);
+ if (fd >= 0)
+ ioctl (fd, TIOCCONS);
session->console_is_redirected = false;
}
(ply_event_handler_t)
ply_terminal_session_on_hangup, session);
- ply_logger_set_output_fd (session->logger, open ("/dev/tty1", O_WRONLY));
+ ply_logger_set_output_fd (session->logger, open ("/dev/tty1", O_WRONLY | O_NOCTTY));
ply_logger_flush (session->logger);
}