From 7441770cfd70bbd3caafd6cf035dd74a860741ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Andr=C3=A9e?= Date: Sat, 7 Jul 2018 09:26:20 +0200 Subject: [PATCH] tty: fix exit value on error from 1 to 2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- 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 @@ -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, "") || !tty; + enfshut(2, stdout, ""); + return !tty; }