tty: Use proper definition of exit status code and stdin macro
Reviewed by: bapt, bdrewery Differential Revision: https://reviews.freebsd.org/D6828
This commit is contained in:
parent
30758bfe03
commit
2f07869625
@ -63,17 +63,18 @@ main(int argc, char *argv[])
|
||||
case '?':
|
||||
default:
|
||||
usage();
|
||||
/* NOTREACHED */
|
||||
}
|
||||
|
||||
t = ttyname(0);
|
||||
t = ttyname(STDIN_FILENO);
|
||||
if (!sflag)
|
||||
puts(t ? t : "not a tty");
|
||||
exit(t ? 0 : 1);
|
||||
exit(t ? EXIT_SUCCESS : EXIT_FAILURE);
|
||||
}
|
||||
|
||||
static void
|
||||
usage(void)
|
||||
{
|
||||
fprintf(stderr, "usage: tty [-s]\n");
|
||||
fprintf(stderr, "usage: %s [-s]\n", getprogname());
|
||||
exit(2);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user