diff options
author | aldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2007-01-20 21:30:49 +0000 |
---|---|---|
committer | aldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2007-01-20 21:30:49 +0000 |
commit | fda0a88c4c2104356e2dde0b03a3177af56647e6 (patch) | |
tree | 6021d0d5f014db429cf8dda0fa475e3d449ed7be | |
parent | 629be292e15fd32f5625ca73143070bd22d8e0a2 (diff) | |
download | busybox-w32-fda0a88c4c2104356e2dde0b03a3177af56647e6.tar.gz busybox-w32-fda0a88c4c2104356e2dde0b03a3177af56647e6.tar.bz2 busybox-w32-fda0a88c4c2104356e2dde0b03a3177af56647e6.zip |
- reuse retval for the option handling.
- TODO add tee, readahead and splice support to uClibc and use it in busybox!
git-svn-id: svn://busybox.net/trunk/busybox@17417 69ca8d6d-28ef-0310-b511-8ec308f3f277
-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 640a231ef..248fd1445 100644 --- a/coreutils/tee.c +++ b/coreutils/tee.c | |||
@@ -20,23 +20,23 @@ int tee_main(int argc, char **argv) | |||
20 | FILE **fp; | 20 | FILE **fp; |
21 | char **names; | 21 | char **names; |
22 | char **np; | 22 | char **np; |
23 | int flags; | 23 | char retval; |
24 | int retval = EXIT_SUCCESS; | ||
25 | #if ENABLE_FEATURE_TEE_USE_BLOCK_IO | 24 | #if ENABLE_FEATURE_TEE_USE_BLOCK_IO |
26 | ssize_t c; | 25 | ssize_t c; |
27 | # define buf bb_common_bufsiz1 | 26 | # define buf bb_common_bufsiz1 |
28 | #else | 27 | #else |
29 | int c; | 28 | int c; |
30 | #endif | 29 | #endif |
31 | flags = getopt32(argc, argv, "ia"); /* 'a' must be 2nd */ | 30 | retval = getopt32(argc, argv, "ia"); /* 'a' must be 2nd */ |
32 | argc -= optind; | 31 | argc -= optind; |
33 | argv += optind; | 32 | argv += optind; |
34 | 33 | ||
35 | mode += (flags & 2); /* Since 'a' is the 2nd option... */ | 34 | mode += (retval & 2); /* Since 'a' is the 2nd option... */ |
36 | 35 | ||
37 | if (flags & 1) { | 36 | if (retval & 1) { |
38 | signal(SIGINT, SIG_IGN); /* TODO - switch to sigaction. */ | 37 | signal(SIGINT, SIG_IGN); /* TODO - switch to sigaction. */ |
39 | } | 38 | } |
39 | retval = EXIT_SUCCESS; | ||
40 | /* gnu tee ignores SIGPIPE in case one of the output files is a pipe | 40 | /* gnu tee ignores SIGPIPE in case one of the output files is a pipe |
41 | * that doesn't consume all its input. Good idea... */ | 41 | * that doesn't consume all its input. Good idea... */ |
42 | signal(SIGPIPE, SIG_IGN); /* TODO - switch to sigaction. */ | 42 | signal(SIGPIPE, SIG_IGN); /* TODO - switch to sigaction. */ |