tty -s support

Alexander Griesser support at agits.at
Thu Aug 12 15:17:47 UTC 2010


Hey there,

today I tried to run a script on one of my busybox installations which 
has been created by the famous “makeself” script.
It failed because the tty command did not support the “-s” option.

I wanted to quickly add that option to tty and found out, that it’s 
already in there, but is only enabled in SUSv2 mode?

Here’s the code in coreutils/tty.c:

         IF_INCLUDE_SUSv2(silent = getopt32(argv, "s");)
         IF_INCLUDE_SUSv2(argv += optind;)
         IF_NOT_INCLUDE_SUSv2(argv += 1;)


And here’s what I found when grepping through the whole busybox source 
for IF_INCLUDE_SUSv2:

# grep -r IF_INCLUDE_SUSv2 *
coreutils/tty.c:      IF_INCLUDE_SUSv2(int silent;) /* Note: No longer 
relevant in SUSv3. */
coreutils/tty.c:      IF_INCLUDE_SUSv2(silent = getopt32(argv, "s");)
coreutils/tty.c:      IF_INCLUDE_SUSv2(argv += optind;)
coreutils/tty.c:      IF_INCLUDE_SUSv2(if (!silent) puts(s);)
include/usage.h:      IF_INCLUDE_SUSv2( "\n" \
include/autoconf.h:#define IF_INCLUDE_SUSv2(...)
include/usage.src.h:  IF_INCLUDE_SUSv2( "\n" \

So, is it safe to assume that this needs to be cleaned up since it is 
not used anywhere else?

bye and thanks,
Alex


More information about the busybox mailing list