summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1999-09-22 16:55:13 +0000
committerRoland McGrath <roland@gnu.org>1999-09-22 16:55:13 +0000
commitc768ab20b40d915c7bf59e94e0c6621c95d2a8a3 (patch)
treeb3300bc4eeea93ec362488df059a7827181a48ca
parent86b7ebcc0862e06ac42686a5723907563bd1400c (diff)
1999-09-22 Roland McGrath <roland@baalperazim.frob.com>
* getty.c (main): Make TTY our controlling terminal with TIOCSCTTY.
-rw-r--r--daemons/getty.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/daemons/getty.c b/daemons/getty.c
index e88810b5..d6706450 100644
--- a/daemons/getty.c
+++ b/daemons/getty.c
@@ -30,6 +30,7 @@
#include <stdlib.h>
#include <string.h>
#include <utmp.h>
+#include <sys/ioctl.h>
/* XXX */
extern char *localhost ();
@@ -94,6 +95,9 @@ main (int argc, char **argv)
}
while (tty == -1);
+ if (ioctl (tty, TIOCSCTTY) < 0)
+ syslog (LOG_ERR, "cannot set controlling terminal to %s: %m", ttyname);
+
print_banner (tty, ttyname);
login_tty (tty);