diff options
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/tty.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/coreutils/tty.c b/coreutils/tty.c index 74a4ea3d6..975ccdfaa 100644 --- a/coreutils/tty.c +++ b/coreutils/tty.c | |||
@@ -7,8 +7,8 @@ | |||
7 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. |
8 | */ | 8 | */ |
9 | 9 | ||
10 | /* BB_AUDIT SUSv3 compliant */ | 10 | /* BB_AUDIT SUSv4 compliant */ |
11 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/tty.html */ | 11 | /* http://www.opengroup.org/onlinepubs/9699919799/utilities/tty.html */ |
12 | 12 | ||
13 | #include "libbb.h" | 13 | #include "libbb.h" |
14 | 14 | ||
@@ -28,14 +28,14 @@ int tty_main(int argc, char **argv IF_NOT_INCLUDE_SUSv2(UNUSED_PARAM)) | |||
28 | /* gnu tty outputs a warning that it is ignoring all args. */ | 28 | /* gnu tty outputs a warning that it is ignoring all args. */ |
29 | bb_warn_ignoring_args(argc); | 29 | bb_warn_ignoring_args(argc); |
30 | 30 | ||
31 | retval = 0; | 31 | retval = EXIT_SUCCESS; |
32 | 32 | ||
33 | s = xmalloc_ttyname(0); | 33 | s = xmalloc_ttyname(STDIN_FILENO); |
34 | if (s == NULL) { | 34 | if (s == NULL) { |
35 | /* According to SUSv3, ttyname can fail with EBADF or ENOTTY. | 35 | /* According to SUSv3, ttyname can fail with EBADF or ENOTTY. |
36 | * We know the file descriptor is good, so failure means not a tty. */ | 36 | * We know the file descriptor is good, so failure means not a tty. */ |
37 | s = "not a tty"; | 37 | s = "not a tty"; |
38 | retval = 1; | 38 | retval = EXIT_FAILURE; |
39 | } | 39 | } |
40 | IF_INCLUDE_SUSv2(if (!silent) puts(s);) | 40 | IF_INCLUDE_SUSv2(if (!silent) puts(s);) |
41 | IF_NOT_INCLUDE_SUSv2(puts(s);) | 41 | IF_NOT_INCLUDE_SUSv2(puts(s);) |