- reuse retval for the option handling.

- TODO add tee, readahead and splice support to uClibc and use it in busybox!
This commit is contained in:
Bernhard Reutner-Fischer 2007-01-20 21:30:49 +00:00
parent 088a212bf5
commit b31c252860

View File

@ -20,23 +20,23 @@ int tee_main(int argc, char **argv)
FILE **fp; FILE **fp;
char **names; char **names;
char **np; char **np;
int flags; char retval;
int retval = EXIT_SUCCESS;
#if ENABLE_FEATURE_TEE_USE_BLOCK_IO #if ENABLE_FEATURE_TEE_USE_BLOCK_IO
ssize_t c; ssize_t c;
# define buf bb_common_bufsiz1 # define buf bb_common_bufsiz1
#else #else
int c; int c;
#endif #endif
flags = getopt32(argc, argv, "ia"); /* 'a' must be 2nd */ retval = getopt32(argc, argv, "ia"); /* 'a' must be 2nd */
argc -= optind; argc -= optind;
argv += optind; argv += optind;
mode += (flags & 2); /* Since 'a' is the 2nd option... */ mode += (retval & 2); /* Since 'a' is the 2nd option... */
if (flags & 1) { if (retval & 1) {
signal(SIGINT, SIG_IGN); /* TODO - switch to sigaction. */ signal(SIGINT, SIG_IGN); /* TODO - switch to sigaction. */
} }
retval = EXIT_SUCCESS;
/* gnu tee ignores SIGPIPE in case one of the output files is a pipe /* gnu tee ignores SIGPIPE in case one of the output files is a pipe
* that doesn't consume all its input. Good idea... */ * that doesn't consume all its input. Good idea... */
signal(SIGPIPE, SIG_IGN); /* TODO - switch to sigaction. */ signal(SIGPIPE, SIG_IGN); /* TODO - switch to sigaction. */