ubase

suckless linux base utils
git clone git://git.2f30.org/ubase.git
Log | Files | Refs | README | LICENSE

commit 459f82212e3893182ae923665c538cd5efb3489f
parent c4388962b063a8f3d428ac40a00cbde0bc0d137f
Author: sin <sin@2f30.org>
Date:   Sun Nov 30 13:04:47 +0000

Check if 0, 1, 2 are valid tty file descriptors

Diffstat:
login.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/login.c b/login.c @@ -71,8 +71,8 @@ main(int argc, char *argv[]) if (argc < 1) usage(); - if (isatty(STDIN_FILENO) == 0) - eprintf("stdin is not a tty\n"); + if (isatty(0) == 0 || isatty(1) == 0 || isatty(2) == 0) + eprintf("no tty"); user = argv[0]; errno = 0;