1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-04 12:52:15 +00: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:
Sofian Brabez 2016-08-16 14:15:09 +00:00
parent 0fa047b98c
commit 80a2905883
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=304220

View File

@ -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);
}