wok 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 e302f23fcd54
children fb327e5adb6b
files busybox/receipt busybox/stuff/busybox-1.20-getty.u
line diff
     1.1 --- a/busybox/receipt	Sat May 05 19:17:33 2012 +0200
     1.2 +++ b/busybox/receipt	Sun May 06 18:15:24 2012 +0200
     1.3 @@ -30,6 +30,7 @@
     1.4  cmdline.u
     1.5  su-nochdir.u
     1.6  diff.u
     1.7 +getty.u
     1.8  EOT
     1.9      cp $stuff/$PACKAGE-${VERSION%.*}.config .config
    1.10  }
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/busybox/stuff/busybox-1.20-getty.u	Sun May 06 18:15:24 2012 +0200
     2.3 @@ -0,0 +1,17 @@
     2.4 +--- busybox-1.20.0/loginutils/getty.c
     2.5 ++++ busybox-1.20.0/loginutils/getty.c
     2.6 +@@ -561,8 +561,14 @@ int getty_main(int argc UNUSED_PARAM, ch
     2.7 + 		 */
     2.8 + 		fd = open("/dev/tty", O_RDWR | O_NONBLOCK);
     2.9 + 		if (fd >= 0) {
    2.10 ++			/* TIOCNOTTY sends SIGHUP to the foreground
    2.11 ++			 * process group - which may include us!
    2.12 ++			 * Make sure to not die on it:
    2.13 ++			 */
    2.14 ++			sighandler_t old = signal(SIGHUP, SIG_IGN);
    2.15 + 			ioctl(fd, TIOCNOTTY);
    2.16 + 			close(fd);
    2.17 ++			signal(SIGHUP, old);
    2.18 + 		}
    2.19 + 	}
    2.20 +