Don't die on vhangup() failure

We might be able to continue at this point.
This commit is contained in:
sin 2014-02-11 10:14:09 +00:00
parent 9a4fba0251
commit 48b505fad3

View File

@ -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)