summaryrefslogtreecommitdiff
path: root/coreutils/tty.c
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer2009-10-29 21:37:48 +0100
committerBernhard Reutner-Fischer2009-10-29 21:37:48 +0100
commit95a036e125c28dc93d91ae77923c02a1684fc5ef (patch)
tree36ae1983edf686561b764bf0516b6821c73081c3 /coreutils/tty.c
parent85ca327529afeceed41c1d66d0b7d48c2ffc2a4b (diff)
downloadbusybox-95a036e125c28dc93d91ae77923c02a1684fc5ef.zip
busybox-95a036e125c28dc93d91ae77923c02a1684fc5ef.tar.gz
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/tty.c')
-rw-r--r--coreutils/tty.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/coreutils/tty.c b/coreutils/tty.c
index 74a4ea3..975ccdf 100644
--- a/coreutils/tty.c
+++ b/coreutils/tty.c
@@ -7,8 +7,8 @@
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
-/* BB_AUDIT SUSv3 compliant */
-/* http://www.opengroup.org/onlinepubs/007904975/utilities/tty.html */
+/* BB_AUDIT SUSv4 compliant */
+/* http://www.opengroup.org/onlinepubs/9699919799/utilities/tty.html */
#include "libbb.h"
@@ -28,14 +28,14 @@ int tty_main(int argc, char **argv IF_NOT_INCLUDE_SUSv2(UNUSED_PARAM))
/* gnu tty outputs a warning that it is ignoring all args. */
bb_warn_ignoring_args(argc);
- retval = 0;
+ retval = EXIT_SUCCESS;
- s = xmalloc_ttyname(0);
+ s = xmalloc_ttyname(STDIN_FILENO);
if (s == NULL) {
/* According to SUSv3, ttyname can fail with EBADF or ENOTTY.
* We know the file descriptor is good, so failure means not a tty. */
s = "not a tty";
- retval = 1;
+ retval = EXIT_FAILURE;
}
IF_INCLUDE_SUSv2(if (!silent) puts(s);)
IF_NOT_INCLUDE_SUSv2(puts(s);)