[hackers] [PATCH] tty: fix exit value on error from 1 to 2

From: Mattias Andrée <maandree_AT_kth.se>
Date: Sat, 7 Jul 2018 09:26:20 +0200

Signed-off-by: Mattias Andrée <maandree_AT_kth.se>
---
 tty.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
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;
 }
-- 
2.11.1
Received on Sat Jul 07 2018 - 09:26:20 CEST

This archive was generated by hypermail 2.3.0 : Sat Jul 07 2018 - 09:36:25 CEST