svn commit: trunk/busybox/coreutils

aldot at busybox.net aldot at busybox.net
Sat Jan 20 21:30:49 UTC 2007


Author: aldot
Date: 2007-01-20 13:30:49 -0800 (Sat, 20 Jan 2007)
New Revision: 17417

Log:
- reuse retval for the option handling.
- TODO add tee, readahead and splice support to uClibc and use it in busybox!


Modified:
   trunk/busybox/coreutils/tee.c


Changeset:
Modified: trunk/busybox/coreutils/tee.c
===================================================================
--- trunk/busybox/coreutils/tee.c	2007-01-20 21:29:50 UTC (rev 17416)
+++ trunk/busybox/coreutils/tee.c	2007-01-20 21:30:49 UTC (rev 17417)
@@ -20,23 +20,23 @@
 	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. */




More information about the busybox-cvs mailing list