From 48b505fad321ecab5a6360fd7b92e1e7a85e3d63 Mon Sep 17 00:00:00 2001 From: sin Date: Tue, 11 Feb 2014 10:14:09 +0000 Subject: [PATCH] Don't die on vhangup() failure We might be able to continue at this point. --- getty.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/getty.c b/getty.c index 46781f6..ad15279 100644 --- a/getty.c +++ b/getty.c @@ -59,12 +59,11 @@ main(int argc, char *argv[]) eprintf("open %s:", tty); if (isatty(fd) == 0) eprintf("%s is not a tty\n", tty); - if (ioctl(fd, TIOCSCTTY, (void *)1) == 0) { - if (vhangup() < 0) - eprintf("vhangup:"); - } else { + if (ioctl(fd, TIOCSCTTY, (void *)1) == 0) + vhangup(); + else fprintf(stderr, "could not set controlling tty\n"); - } + close(fd); fd = open(tty, O_RDWR); if (fd < 0)