aboutsummaryrefslogtreecommitdiff
path: root/loginutils
diff options
context:
space:
mode:
Diffstat (limited to 'loginutils')
-rw-r--r--loginutils/getty.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/loginutils/getty.c b/loginutils/getty.c
index afb411b98..bbb5a96b4 100644
--- a/loginutils/getty.c
+++ b/loginutils/getty.c
@@ -561,8 +561,14 @@ int getty_main(int argc UNUSED_PARAM, char **argv)
561 */ 561 */
562 fd = open("/dev/tty", O_RDWR | O_NONBLOCK); 562 fd = open("/dev/tty", O_RDWR | O_NONBLOCK);
563 if (fd >= 0) { 563 if (fd >= 0) {
564 /* TIOCNOTTY sends SIGHUP to the foreground
565 * process group - which may include us!
566 * Make sure to not die on it:
567 */
568 sighandler_t old = signal(SIGHUP, SIG_IGN);
564 ioctl(fd, TIOCNOTTY); 569 ioctl(fd, TIOCNOTTY);
565 close(fd); 570 close(fd);
571 signal(SIGHUP, old);
566 } 572 }
567 } 573 }
568 574