projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b84dafb
)
getty: fix for NOCTTY killing us with SIGHUP
author
Denys Vlasenko
<vda.linux@googlemail.com>
Thu, 26 Apr 2012 08:53:48 +0000
(10:53 +0200)
committer
Denys Vlasenko
<vda.linux@googlemail.com>
Thu, 26 Apr 2012 08:53:48 +0000
(10:53 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
loginutils/getty.c
patch
|
blob
|
history
diff --git
a/loginutils/getty.c
b/loginutils/getty.c
index afb411b981f593c3fea6d6d3fd8b5cfcd1e8be03..bbb5a96b4237731e767041e711bda8eb6d7dceee 100644
(file)
--- a/
loginutils/getty.c
+++ b/
loginutils/getty.c
@@
-561,8
+561,14
@@
int getty_main(int argc UNUSED_PARAM, char **argv)
*/
fd = open("/dev/tty", O_RDWR | O_NONBLOCK);
if (fd >= 0) {
+ /* TIOCNOTTY sends SIGHUP to the foreground
+ * process group - which may include us!
+ * Make sure to not die on it:
+ */
+ sighandler_t old = signal(SIGHUP, SIG_IGN);
ioctl(fd, TIOCNOTTY);
close(fd);
+ signal(SIGHUP, old);
}
}