wok diff busybox/stuff/busybox-1.20-getty.u @ rev 12732
busybox: add getty fix from busybox.net
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun May 06 18:15:24 2012 +0200 (2012-05-06) |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/busybox/stuff/busybox-1.20-getty.u Sun May 06 18:15:24 2012 +0200 1.3 @@ -0,0 +1,17 @@ 1.4 +--- busybox-1.20.0/loginutils/getty.c 1.5 ++++ busybox-1.20.0/loginutils/getty.c 1.6 +@@ -561,8 +561,14 @@ int getty_main(int argc UNUSED_PARAM, ch 1.7 + */ 1.8 + fd = open("/dev/tty", O_RDWR | O_NONBLOCK); 1.9 + if (fd >= 0) { 1.10 ++ /* TIOCNOTTY sends SIGHUP to the foreground 1.11 ++ * process group - which may include us! 1.12 ++ * Make sure to not die on it: 1.13 ++ */ 1.14 ++ sighandler_t old = signal(SIGHUP, SIG_IGN); 1.15 + ioctl(fd, TIOCNOTTY); 1.16 + close(fd); 1.17 ++ signal(SIGHUP, old); 1.18 + } 1.19 + } 1.20 +