diff options
| author | Edward Tomasz Napierala <trasz@FreeBSD.org> | 2018-02-25 20:15:06 +0000 |
|---|---|---|
| committer | Edward Tomasz Napierala <trasz@FreeBSD.org> | 2018-02-25 20:15:06 +0000 |
| commit | 170430d505c6436be9747cbee04e734eb7eff831 (patch) | |
| tree | ddda255efe16a68d6c0d1f30fc5a63345c6f7724 | |
| parent | 615395d9851af5e55ca315ba25b7f787c2e4af13 (diff) | |
Notes
| -rw-r--r-- | libexec/getty/main.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libexec/getty/main.c b/libexec/getty/main.c index c4f396d7f8a9..78b352d11884 100644 --- a/libexec/getty/main.c +++ b/libexec/getty/main.c @@ -427,15 +427,17 @@ main(int argc, char *argv[]) static int opentty(const char *tty, int flags) { - int i; - int failopenlogged = 0; + int failopenlogged = 0, i, saved_errno; while ((i = open(tty, flags)) == -1) { + saved_errno = errno; if (!failopenlogged) { syslog(LOG_ERR, "open %s: %m", tty); failopenlogged = 1; } + if (saved_errno == ENOENT) + return 0; sleep(60); } if (login_tty(i) < 0) { |
