sbase

suckless unix tools
git clone git://git.2f30.org/sbase.git
Log | Files | Refs | README | LICENSE

commit 7441770cfd70bbd3caafd6cf035dd74a860741ae
parent 084b46ac51e36bfa6491008ca78c857f297f70fe
Author: Mattias Andrée <maandree@kth.se>
Date:   Sat,  7 Jul 2018 09:26:20 +0200

tty: fix exit value on error from 1 to 2

Signed-off-by: Mattias Andrée <maandree@kth.se>

Diffstat:
tty.c | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 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; }