diff options
author | Bernhard Reutner-Fischer | 2007-01-20 21:30:49 +0000 |
---|---|---|
committer | Bernhard Reutner-Fischer | 2007-01-20 21:30:49 +0000 |
commit | b31c2528602039ac21dc4fbeba317596615317f6 (patch) | |
tree | 6021d0d5f014db429cf8dda0fa475e3d449ed7be | |
parent | 088a212bf58ec3472f27784ebb1fc898e0f99918 (diff) | |
download | busybox-b31c2528602039ac21dc4fbeba317596615317f6.zip busybox-b31c2528602039ac21dc4fbeba317596615317f6.tar.gz |
- reuse retval for the option handling.
- TODO add tee, readahead and splice support to uClibc and use it in busybox!
-rw-r--r-- | coreutils/tee.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/coreutils/tee.c b/coreutils/tee.c index 640a231..248fd14 100644 --- a/coreutils/tee.c +++ b/coreutils/tee.c @@ -20,23 +20,23 @@ int tee_main(int argc, char **argv) FILE **fp; char **names; char **np; - int flags; - int retval = EXIT_SUCCESS; + char retval; #if ENABLE_FEATURE_TEE_USE_BLOCK_IO ssize_t c; # define buf bb_common_bufsiz1 #else int c; #endif - flags = getopt32(argc, argv, "ia"); /* 'a' must be 2nd */ + retval = getopt32(argc, argv, "ia"); /* 'a' must be 2nd */ argc -= 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. */ } + retval = EXIT_SUCCESS; /* gnu tee ignores SIGPIPE in case one of the output files is a pipe * that doesn't consume all its input. Good idea... */ signal(SIGPIPE, SIG_IGN); /* TODO - switch to sigaction. */ |