commit 7441770cfd70bbd3caafd6cf035dd74a860741ae
Author:     Mattias Andrée <[email protected]>
AuthorDate: Sat Jul 7 09:26:20 2018 +0200
Commit:     sin <[email protected]>
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 <[email protected]>

diff --git a/tty.c b/tty.c
index a57cb8e..7ffb04a 100644
--- a/tty.c
+++ b/tty.c
@@ -7,7 +7,7 @@
 static void
 usage(void)
 {
-       eprintf("usage: %s\n", argv0);
+       enprintf(2, "usage: %s\n", argv0);
 }
 
 int
@@ -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;
 }

Reply via email to