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.
This commit is contained in:
parent
fa38f371c8
commit
780afd18cd
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=135941
@ -427,23 +427,17 @@ 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");
|
||||
@ -458,7 +452,6 @@ opentty(const char *tty, int flags)
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
defttymode()
|
||||
|
Loading…
Reference in New Issue
Block a user