commit 48b505fad321ecab5a6360fd7b92e1e7a85e3d63
parent 9a4fba02519efc4382fd605ec144ace2fd461798
Author: sin <sin@2f30.org>
Date: Tue, 11 Feb 2014 10:14:09 +0000
Don't die on vhangup() failure
We might be able to continue at this point.
Diffstat:
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git 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)