mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
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
0fa047b98c
commit
80a2905883
1 changed files with 4 additions and 3 deletions
|
|
@ -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 a new issue