aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2009-10-29 21:37:48 +0100
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2009-10-29 21:37:48 +0100
commit95a036e125c28dc93d91ae77923c02a1684fc5ef (patch)
tree36ae1983edf686561b764bf0516b6821c73081c3 /coreutils
parent85ca327529afeceed41c1d66d0b7d48c2ffc2a4b (diff)
downloadbusybox-w32-95a036e125c28dc93d91ae77923c02a1684fc5ef.tar.gz
busybox-w32-95a036e125c28dc93d91ae77923c02a1684fc5ef.tar.bz2
busybox-w32-95a036e125c28dc93d91ae77923c02a1684fc5ef.zip
tty: use defines rather than constants
No obj-code changes. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/tty.c10
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);)