[hackers] [sbase] tty: fix exit value on error from 1 to 2 || Mattias Andrée
commit 7441770cfd70bbd3caafd6cf035dd74a860741ae
Author: Mattias Andrée <maandree_AT_kth.se>
AuthorDate: Sat Jul 7 09:26:20 2018 +0200
Commit: sin <sin_AT_2f30.org>
CommitDate: Sat Jul 7 12:18:50 2018 +0100
tty: fix exit value on error from 1 to 2
Signed-off-by: Mattias Andrée <maandree_AT_kth.se>
diff --git a/tty.c b/tty.c
index a57cb8e..7ffb04a 100644
--- a/tty.c
+++ b/tty.c
_AT_@ -7,7 +7,7 @@
static void
usage(void)
{
- eprintf("usage: %s\n", argv0);
+ enprintf(2, "usage: %s\n", argv0);
}
int
_AT_@ -23,5 +23,6 @@ main(int argc, char *argv[])
tty = ttyname(STDIN_FILENO);
puts(tty ? tty : "not a tty");
- return fshut(stdout, "<stdout>") || !tty;
+ enfshut(2, stdout, "<stdout>");
+ return !tty;
}
Received on Sat Jul 07 2018 - 13:19:16 CEST
This archive was generated by hypermail 2.3.0
: Sat Jul 07 2018 - 13:24:25 CEST