svn commit: trunk/busybox: archival/libunarchive coreutils editors etc...

vda at busybox.net vda at busybox.net
Mon Jan 28 22:45:46 UTC 2008


Author: vda
Date: 2008-01-28 14:45:43 -0800 (Mon, 28 Jan 2008)
New Revision: 20915

Log:
*: tidy up usage of char **environ



Modified:
   trunk/busybox/archival/libunarchive/open_transformer.c
   trunk/busybox/coreutils/env.c
   trunk/busybox/coreutils/printenv.c
   trunk/busybox/editors/awk.c
   trunk/busybox/include/libbb.h
   trunk/busybox/networking/inetd.c
   trunk/busybox/runit/runsv.c
   trunk/busybox/runit/svlogd.c
   trunk/busybox/shell/ash.c
   trunk/busybox/shell/hush.c
   trunk/busybox/shell/msh.c


Changeset:
Modified: trunk/busybox/archival/libunarchive/open_transformer.c
===================================================================
--- trunk/busybox/archival/libunarchive/open_transformer.c	2008-01-28 09:39:30 UTC (rev 20914)
+++ trunk/busybox/archival/libunarchive/open_transformer.c	2008-01-28 22:45:43 UTC (rev 20915)
@@ -30,7 +30,7 @@
 
 	if (pid == 0) {
 		/* child process */
-		close(fd_pipe[0]); /* We don't wan't to read from the parent */
+		close(fd_pipe[0]); /* We don't want to read from the parent */
 		// FIXME: error check?
 #if BB_MMU
 		transformer(src_fd, fd_pipe[1]);

Modified: trunk/busybox/coreutils/env.c
===================================================================
--- trunk/busybox/coreutils/env.c	2008-01-28 09:39:30 UTC (rev 20914)
+++ trunk/busybox/coreutils/env.c	2008-01-28 22:45:43 UTC (rev 20915)
@@ -30,8 +30,6 @@
  */
 
 #include <getopt.h> /* struct option */
-extern char **environ;
-
 #include "libbb.h"
 
 #if ENABLE_FEATURE_ENV_LONG_OPTIONS

Modified: trunk/busybox/coreutils/printenv.c
===================================================================
--- trunk/busybox/coreutils/printenv.c	2008-01-28 09:39:30 UTC (rev 20914)
+++ trunk/busybox/coreutils/printenv.c	2008-01-28 22:45:43 UTC (rev 20915)
@@ -9,7 +9,6 @@
  */
 
 #include "libbb.h"
-extern char **environ;
 
 int printenv_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
 int printenv_main(int argc, char **argv)

Modified: trunk/busybox/editors/awk.c
===================================================================
--- trunk/busybox/editors/awk.c	2008-01-28 09:39:30 UTC (rev 20914)
+++ trunk/busybox/editors/awk.c	2008-01-28 22:45:43 UTC (rev 20915)
@@ -10,7 +10,6 @@
 #include "libbb.h"
 #include "xregex.h"
 #include <math.h>
-extern char **environ;
 
 /* This is a NOEXEC applet. Be very careful! */
 

Modified: trunk/busybox/include/libbb.h
===================================================================
--- trunk/busybox/include/libbb.h	2008-01-28 09:39:30 UTC (rev 20914)
+++ trunk/busybox/include/libbb.h	2008-01-28 22:45:43 UTC (rev 20915)
@@ -67,6 +67,9 @@
 #include "shadow_.h"
 #endif
 
+/* Some libc's don't declare it, help them */
+extern char **environ;
+
 #if defined(__GLIBC__) && __GLIBC__ < 2
 int vdprintf(int d, const char *format, va_list ap);
 #endif

Modified: trunk/busybox/networking/inetd.c
===================================================================
--- trunk/busybox/networking/inetd.c	2008-01-28 09:39:30 UTC (rev 20914)
+++ trunk/busybox/networking/inetd.c	2008-01-28 22:45:43 UTC (rev 20915)
@@ -172,9 +172,6 @@
 #include <rpc/pmap_clnt.h>
 #endif
 
-extern char **environ;
-
-
 #define _PATH_INETDPID  "/var/run/inetd.pid"
 
 #define CNT_INTVL       60              /* servers in CNT_INTVL sec. */

Modified: trunk/busybox/runit/runsv.c
===================================================================
--- trunk/busybox/runit/runsv.c	2008-01-28 09:39:30 UTC (rev 20914)
+++ trunk/busybox/runit/runsv.c	2008-01-28 22:45:43 UTC (rev 20915)
@@ -279,7 +279,7 @@
 					warn_cannot("setup stdout for control/?");
 				prog[0] = a;
 				prog[1] = NULL;
-				execve(a, prog, environ);
+				execv(a, prog);
 				fatal_cannot("run control/?");
 			}
 			while (safe_waitpid(pid, &w, 0) == -1) {

Modified: trunk/busybox/runit/svlogd.c
===================================================================
--- trunk/busybox/runit/svlogd.c	2008-01-28 09:39:30 UTC (rev 20914)
+++ trunk/busybox/runit/svlogd.c	2008-01-28 22:45:43 UTC (rev 20915)
@@ -252,7 +252,7 @@
 		prog[1] = (char*)"-c";
 		prog[2] = ld->processor;
 		prog[3] = NULL;
-		execve("/bin/sh", prog, environ);
+		execv("/bin/sh", prog);
 		bb_perror_msg_and_die(FATAL"cannot %s processor %s", "run", ld->name);
 	}
 	ld->ppid = pid;

Modified: trunk/busybox/shell/ash.c
===================================================================
--- trunk/busybox/shell/ash.c	2008-01-28 09:39:30 UTC (rev 20914)
+++ trunk/busybox/shell/ash.c	2008-01-28 22:45:43 UTC (rev 20915)
@@ -60,7 +60,6 @@
 #if JOBS || ENABLE_ASH_READ_NCHARS
 #include <termios.h>
 #endif
-extern char **environ;
 
 #if defined(__uClinux__)
 #error "Do not even bother, ash will not run on uClinux"

Modified: trunk/busybox/shell/hush.c
===================================================================
--- trunk/busybox/shell/hush.c	2008-01-28 09:39:30 UTC (rev 20914)
+++ trunk/busybox/shell/hush.c	2008-01-28 22:45:43 UTC (rev 20915)
@@ -81,8 +81,6 @@
 #include <getopt.h>    /* should be pretty obvious */
 /* #include <dmalloc.h> */
 
-extern char **environ; /* This is in <unistd.h>, but protected with __USE_GNU */
-
 #include "busybox.h" /* for APPLET_IS_NOFORK/NOEXEC */
 
 

Modified: trunk/busybox/shell/msh.c
===================================================================
--- trunk/busybox/shell/msh.c	2008-01-28 09:39:30 UTC (rev 20914)
+++ trunk/busybox/shell/msh.c	2008-01-28 22:45:43 UTC (rev 20915)
@@ -84,7 +84,6 @@
 }
 #else
 # include "busybox.h" /* for applet_names */
-extern char **environ;
 #endif
 
 /*#define MSHDEBUG 1*/
@@ -2825,11 +2824,13 @@
 
 	if (pin != NULL) {
 		xmove_fd(pin[0], 0);
-		if (pin[1] != 0) close(pin[1]);
+		if (pin[1] != 0)
+			close(pin[1]);
 	}
 	if (pout != NULL) {
 		xmove_fd(pout[1], 1);
-		if (pout[1] != 1) close(pout[0]);
+		if (pout[1] != 1)
+			close(pout[0]);
 	}
 
 	iopp = t->ioact;
@@ -4181,7 +4182,8 @@
 	 *  echo "$files" >zz
 	 */
 	xmove_fd(pf[1], 1);
-	if (pf[0] != 1) close(pf[0]);
+	if (pf[0] != 1)
+		close(pf[0]);
 
 	argument_list[0] = (char *) DEFAULT_SHELL;
 	argument_list[1] = (char *) "-c";




More information about the busybox-cvs mailing list