summaryrefslogtreecommitdiffstats
path: root/libexec/getty
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2004-09-29 20:55:14 +0000
committerimp <imp@FreeBSD.org>2004-09-29 20:55:14 +0000
commite1f9385d4bb3eb22e2342f291f5ae75946d5a5cf (patch)
tree39cd332e449d56f9e8b371270c0b362149a01220 /libexec/getty
parent2411b47f689f472abc49c5961e7dd84b6bfd3748 (diff)
downloadFreeBSD-src-e1f9385d4bb3eb22e2342f291f5ae75946d5a5cf.zip
FreeBSD-src-e1f9385d4bb3eb22e2342f291f5ae75946d5a5cf.tar.gz
Report once that the device isn't there, but keep trying. Don't
filter the errno values. They don't make as much sense as they used to given how we do devices in /dev.
Diffstat (limited to 'libexec/getty')
-rw-r--r--libexec/getty/main.c35
1 files changed, 14 insertions, 21 deletions
diff --git a/libexec/getty/main.c b/libexec/getty/main.c
index 1555ae4..ceea009 100644
--- a/libexec/getty/main.c
+++ b/libexec/getty/main.c
@@ -427,37 +427,30 @@ main(int argc, char *argv[])
static int
opentty(const char *tty, int flags)
{
- int i, j = 0;
+ int i;
int failopenlogged = 0;
- while (j < 10 && (i = open(tty, flags)) == -1)
+ while ((i = open(tty, flags)) == -1)
{
- if (((j % 10) == 0) && (errno != ENXIO || !failopenlogged)) {
+ if (!failopenlogged) {
syslog(LOG_ERR, "open %s: %m", tty);
failopenlogged = 1;
}
- j++;
sleep(60);
}
- if (i == -1) {
- syslog(LOG_ERR, "open %s: %m", tty);
- return 0;
- }
- else {
- 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", tty);
- close(i);
- return 0;
- }
+ 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", tty);
+ close(i);
+ return 0;
}
- return 1;
}
+ return 1;
}
static void
OpenPOWER on IntegriCloud