summaryrefslogtreecommitdiff
path: root/libexec/getty
diff options
context:
space:
mode:
authorKris Kennaway <kris@FreeBSD.org>2001-03-05 11:17:08 +0000
committerKris Kennaway <kris@FreeBSD.org>2001-03-05 11:17:08 +0000
commit7e42f0da8778ff597013a6bb29952568a6106fd6 (patch)
treee4681682812a423616457d2cd50244ec29f6b054 /libexec/getty
parent231e5a377dd9d63f7ca3efc4a3a96b71c6463bcb (diff)
Notes
Diffstat (limited to 'libexec/getty')
-rw-r--r--libexec/getty/main.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/libexec/getty/main.c b/libexec/getty/main.c
index 6cd1af834ac2..82d1c86c979c 100644
--- a/libexec/getty/main.c
+++ b/libexec/getty/main.c
@@ -443,7 +443,18 @@ opentty(const char *ttyn, int flags)
return 0;
}
else {
- login_tty(i);
+ if (login_tty(i) < 0) {
+ if (daemon(0,0) < 0) {
+ syslog(LOG_ERR,"daemon: %m");
+ close(i);
+ return 0;
+ }
+ if (login_tty(i) < 0) {
+ syslog(LOG_ERR, "login_tty %s: %m", ttyn);
+ close(i);
+ return 0;
+ }
+ }
return 1;
}
}