tty: fix exit value on error from 1 to 2

Signed-off-by: Mattias Andrée <maandree@kth.se>
This commit is contained in:
Mattias Andrée 2018-07-07 09:26:20 +02:00 committed by sin
parent 084b46ac51
commit 7441770cfd

5
tty.c
View File

@ -7,7 +7,7 @@
static void static void
usage(void) usage(void)
{ {
eprintf("usage: %s\n", argv0); enprintf(2, "usage: %s\n", argv0);
} }
int int
@ -23,5 +23,6 @@ main(int argc, char *argv[])
tty = ttyname(STDIN_FILENO); tty = ttyname(STDIN_FILENO);
puts(tty ? tty : "not a tty"); puts(tty ? tty : "not a tty");
return fshut(stdout, "<stdout>") || !tty; enfshut(2, stdout, "<stdout>");
return !tty;
} }