Don't die on vhangup() failure
We might be able to continue at this point.
This commit is contained in:
parent
9a4fba0251
commit
48b505fad3
9
getty.c
9
getty.c
@ -59,12 +59,11 @@ main(int argc, char *argv[])
|
|||||||
eprintf("open %s:", tty);
|
eprintf("open %s:", tty);
|
||||||
if (isatty(fd) == 0)
|
if (isatty(fd) == 0)
|
||||||
eprintf("%s is not a tty\n", tty);
|
eprintf("%s is not a tty\n", tty);
|
||||||
if (ioctl(fd, TIOCSCTTY, (void *)1) == 0) {
|
if (ioctl(fd, TIOCSCTTY, (void *)1) == 0)
|
||||||
if (vhangup() < 0)
|
vhangup();
|
||||||
eprintf("vhangup:");
|
else
|
||||||
} else {
|
|
||||||
fprintf(stderr, "could not set controlling tty\n");
|
fprintf(stderr, "could not set controlling tty\n");
|
||||||
}
|
|
||||||
close(fd);
|
close(fd);
|
||||||
fd = open(tty, O_RDWR);
|
fd = open(tty, O_RDWR);
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user