tty: fix exit value on error from 1 to 2
Signed-off-by: Mattias Andrée <maandree@kth.se>
This commit is contained in:
parent
084b46ac51
commit
7441770cfd
5
tty.c
5
tty.c
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user