svn commit: trunk/busybox: applets archival console-tools coreutils etc...

vda at busybox.net vda at busybox.net
Mon Mar 17 09:04:05 UTC 2008


Author: vda
Date: 2008-03-17 02:04:04 -0700 (Mon, 17 Mar 2008)
New Revision: 21353

Log:
*: fix fallout from -Wunused-parameter

function                                             old     new   delta
bbunpack                                             358     366      +8
passwd_main                                         1070    1072      +2
handle_incoming_and_exit                            2651    2653      +2
getpty                                                88      86      -2
script_main                                          975     972      -3
inetd_main                                          2036    2033      -3
dname_enc                                            377     373      -4
make_new_session                                     474     462     -12
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/5 up/down: 12/-24)            Total: -12 bytes
   text    data     bss     dec     hex filename
 797429     658    7428  805515   c4a8b busybox_old
 797417     658    7428  805503   c4a7f busybox_unstripped



Modified:
   trunk/busybox/applets/applets.c
   trunk/busybox/archival/bzip2.c
   trunk/busybox/archival/gzip.c
   trunk/busybox/console-tools/reset.c
   trunk/busybox/coreutils/stat.c
   trunk/busybox/findutils/find.c
   trunk/busybox/include/busybox.h
   trunk/busybox/include/libbb.h
   trunk/busybox/include/usage.h
   trunk/busybox/init/halt.c
   trunk/busybox/libbb/appletlib.c
   trunk/busybox/libbb/getpty.c
   trunk/busybox/libbb/lineedit.c
   trunk/busybox/loginutils/login.c
   trunk/busybox/miscutils/bbconfig.c
   trunk/busybox/miscutils/chat.c
   trunk/busybox/modutils/insmod.c
   trunk/busybox/modutils/lsmod.c
   trunk/busybox/networking/Kbuild
   trunk/busybox/networking/ether-wake.c
   trunk/busybox/networking/httpd.c
   trunk/busybox/networking/ifupdown.c
   trunk/busybox/networking/inetd.c
   trunk/busybox/networking/nc.c
   trunk/busybox/networking/sendmail.c
   trunk/busybox/networking/telnetd.c
   trunk/busybox/networking/traceroute.c
   trunk/busybox/networking/udhcp/clientsocket.c
   trunk/busybox/networking/wget.c
   trunk/busybox/procps/ps.c
   trunk/busybox/shell/ash.c
   trunk/busybox/shell/cttyhack.c
   trunk/busybox/util-linux/fbset.c
   trunk/busybox/util-linux/fdisk.c
   trunk/busybox/util-linux/script.c
   trunk/busybox/util-linux/volume_id/get_devname.c


Changeset:
Modified: trunk/busybox/applets/applets.c
===================================================================
--- trunk/busybox/applets/applets.c	2008-03-17 09:02:21 UTC (rev 21352)
+++ trunk/busybox/applets/applets.c	2008-03-17 09:04:04 UTC (rev 21353)
@@ -11,8 +11,8 @@
 #include "busybox.h"
 
 #if ENABLE_BUILD_LIBBUSYBOX
-int main(int argc, char **argv)
+int main(int argc ATTRIBUTE_UNUSED, char **argv)
 {
-	return lbb_main(argc, argv);
+	return lbb_main(argv);
 }
 #endif

Modified: trunk/busybox/archival/bzip2.c
===================================================================
--- trunk/busybox/archival/bzip2.c	2008-03-17 09:02:21 UTC (rev 21352)
+++ trunk/busybox/archival/bzip2.c	2008-03-17 09:04:04 UTC (rev 21353)
@@ -141,7 +141,7 @@
 }
 
 int bzip2_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int bzip2_main(int argc, char **argv)
+int bzip2_main(int argc ATTRIBUTE_UNUSED, char **argv)
 {
 	unsigned opt;
 

Modified: trunk/busybox/archival/gzip.c
===================================================================
--- trunk/busybox/archival/gzip.c	2008-03-17 09:02:21 UTC (rev 21352)
+++ trunk/busybox/archival/gzip.c	2008-03-17 09:04:04 UTC (rev 21353)
@@ -2026,7 +2026,11 @@
 }
 
 int gzip_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
+#if ENABLE_GUNZIP
 int gzip_main(int argc, char **argv)
+#else
+int gzip_main(int argc ATTRIBUTE_UNUSED, char **argv)
+#endif
 {
 	unsigned opt;
 

Modified: trunk/busybox/console-tools/reset.c
===================================================================
--- trunk/busybox/console-tools/reset.c	2008-03-17 09:02:21 UTC (rev 21352)
+++ trunk/busybox/console-tools/reset.c	2008-03-17 09:04:04 UTC (rev 21353)
@@ -40,7 +40,7 @@
 #if ENABLE_STTY
 		return stty_main(2, (char**)args);
 #else
-		execvp("stty", args);
+		execvp("stty", (char**)args);
 #endif
 	}
 	return EXIT_SUCCESS;

Modified: trunk/busybox/coreutils/stat.c
===================================================================
--- trunk/busybox/coreutils/stat.c	2008-03-17 09:02:21 UTC (rev 21352)
+++ trunk/busybox/coreutils/stat.c	2008-03-17 09:04:04 UTC (rev 21353)
@@ -21,6 +21,12 @@
 #define OPT_DEREFERENCE (1 << 2)
 #define OPT_SELINUX     (1 << 3)
 
+#if ENABLE_FEATURE_STAT_FORMAT
+typedef bool (*statfunc_ptr)(const char *, const char *);
+#else
+typedef bool (*statfunc_ptr)(const char *);
+#endif
+
 static const char *file_type(const struct stat *st)
 {
 	/* See POSIX 1003.1-2001 XCU Table 4-8 lines 17093-17107
@@ -338,8 +344,14 @@
 #endif
 
 /* Stat the file system and print what we find.  */
+#if !ENABLE_FEATURE_STAT_FORMAT
+#define do_statfs(filename, format) do_statfs(filename)
+#endif
 static bool do_statfs(const char *filename, const char *format)
 {
+#if !ENABLE_FEATURE_STAT_FORMAT
+	const char *format;
+#endif
 	struct statfs statfsbuf;
 #if ENABLE_SELINUX
 	security_context_t scontext = NULL;
@@ -447,6 +459,9 @@
 }
 
 /* stat the file and print what we find */
+#if !ENABLE_FEATURE_STAT_FORMAT
+#define do_stat(filename, format) do_stat(filename)
+#endif
 static bool do_stat(const char *filename, const char *format)
 {
 	struct stat statbuf;
@@ -612,10 +627,10 @@
 int stat_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
 int stat_main(int argc, char **argv)
 {
-	char *format = NULL;
+	USE_FEATURE_STAT_FORMAT(char *format = NULL;)
 	int i;
 	int ok = 1;
-	bool (*statfunc)(const char *, const char *) = do_stat;
+	statfunc_ptr statfunc = do_stat;
 
 	getopt32(argv, "ftL"
 		USE_SELINUX("Z")
@@ -633,7 +648,7 @@
 	}
 #endif	/* ENABLE_SELINUX */
 	for (i = optind; i < argc; ++i)
-		ok &= statfunc(argv[i], format);
+		ok &= statfunc(argv[i] USE_FEATURE_STAT_FORMAT(, format));
 
 	return (ok ? EXIT_SUCCESS : EXIT_FAILURE);
 }

Modified: trunk/busybox/findutils/find.c
===================================================================
--- trunk/busybox/findutils/find.c	2008-03-17 09:02:21 UTC (rev 21352)
+++ trunk/busybox/findutils/find.c	2008-03-17 09:04:04 UTC (rev 21353)
@@ -374,7 +374,10 @@
 #endif
 
 
-static int fileAction(const char *fileName, struct stat *statbuf, void *userData, int depth)
+static int fileAction(const char *fileName,
+		struct stat *statbuf,
+		void *userData SKIP_FEATURE_FIND_MAXDEPTH(ATTRIBUTE_UNUSED),
+		int depth SKIP_FEATURE_FIND_MAXDEPTH(ATTRIBUTE_UNUSED))
 {
 	int i;
 #if ENABLE_FEATURE_FIND_MAXDEPTH

Modified: trunk/busybox/include/busybox.h
===================================================================
--- trunk/busybox/include/busybox.h	2008-03-17 09:02:21 UTC (rev 21352)
+++ trunk/busybox/include/busybox.h	2008-03-17 09:04:04 UTC (rev 21353)
@@ -64,9 +64,9 @@
 	) MAIN_EXTERNALLY_VISIBLE;
 #if ENABLE_BUILD_LIBBUSYBOX
 #if ENABLE_FEATURE_SHARED_BUSYBOX
-int lbb_main(int argc, char **argv) EXTERNALLY_VISIBLE;
+int lbb_main(char **argv) EXTERNALLY_VISIBLE;
 #else
-int lbb_main(int argc, char **argv);
+int lbb_main(char **argv);
 #endif
 #endif
 

Modified: trunk/busybox/include/libbb.h
===================================================================
--- trunk/busybox/include/libbb.h	2008-03-17 09:02:21 UTC (rev 21352)
+++ trunk/busybox/include/libbb.h	2008-03-17 09:04:04 UTC (rev 21353)
@@ -237,7 +237,8 @@
 	int (*dirAction) (const char *fileName, struct stat* statbuf, void* userData, int depth),
 	void* userData, unsigned depth);
 extern int device_open(const char *device, int mode);
-extern int getpty(char *line, int size);
+enum { GETPTY_BUFSIZE = 16 }; /* more than enough for "/dev/ttyXXX" */
+extern int getpty(char *line);
 extern int get_console_fd(void);
 extern char *find_block_device(const char *path);
 /* bb_copyfd_XX print read/write errors and return -1 if they occur */

Modified: trunk/busybox/include/usage.h
===================================================================
--- trunk/busybox/include/usage.h	2008-03-17 09:02:21 UTC (rev 21352)
+++ trunk/busybox/include/usage.h	2008-03-17 09:04:04 UTC (rev 21353)
@@ -989,6 +989,7 @@
        ""
 #define false_full_usage \
        "Return an exit code of FALSE (1)"
+
 #define false_example_usage \
        "$ false\n" \
        "$ echo $?\n" \

Modified: trunk/busybox/init/halt.c
===================================================================
--- trunk/busybox/init/halt.c	2008-03-17 09:02:21 UTC (rev 21352)
+++ trunk/busybox/init/halt.c	2008-03-17 09:04:04 UTC (rev 21353)
@@ -16,7 +16,7 @@
 #endif
 
 int halt_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int halt_main(int argc, char **argv)
+int halt_main(int argc ATTRIBUTE_UNUSED, char **argv)
 {
 	static const int magic[] = {
 #ifdef RB_HALT_SYSTEM

Modified: trunk/busybox/libbb/appletlib.c
===================================================================
--- trunk/busybox/libbb/appletlib.c	2008-03-17 09:02:21 UTC (rev 21352)
+++ trunk/busybox/libbb/appletlib.c	2008-03-17 09:04:04 UTC (rev 21353)
@@ -661,7 +661,7 @@
 
 
 #if ENABLE_BUILD_LIBBUSYBOX
-int lbb_main(int argc, char **argv)
+int lbb_main(char **argv)
 #else
 int main(int argc ATTRIBUTE_UNUSED, char **argv)
 #endif

Modified: trunk/busybox/libbb/getpty.c
===================================================================
--- trunk/busybox/libbb/getpty.c	2008-03-17 09:02:21 UTC (rev 21352)
+++ trunk/busybox/libbb/getpty.c	2008-03-17 09:04:04 UTC (rev 21353)
@@ -10,7 +10,9 @@
 
 #define DEBUG 0
 
-int getpty(char *line, int size)
+#define DEBUG 0
+
+int getpty(char *line)
 {
 	int p;
 #if ENABLE_FEATURE_DEVPTS
@@ -24,7 +26,7 @@
 			bb_perror_msg("ptsname error (is /dev/pts mounted?)");
 			return -1;
 		}
-		safe_strncpy(line, name, size);
+		safe_strncpy(line, name, GETPTY_BUFSIZE);
 		return p;
 	}
 #else

Modified: trunk/busybox/libbb/lineedit.c
===================================================================
--- trunk/busybox/libbb/lineedit.c	2008-03-17 09:02:21 UTC (rev 21352)
+++ trunk/busybox/libbb/lineedit.c	2008-03-17 09:04:04 UTC (rev 21353)
@@ -294,7 +294,12 @@
 
 /* Delete the char in front of the cursor, optionally saving it
  * for later putback */
+#if !ENABLE_FEATURE_EDITING_VI
+static void input_delete(void)
+#define input_delete(save) input_delete()
+#else
 static void input_delete(int save)
+#endif
 {
 	int j = cursor;
 

Modified: trunk/busybox/loginutils/login.c
===================================================================
--- trunk/busybox/loginutils/login.c	2008-03-17 09:02:21 UTC (rev 21352)
+++ trunk/busybox/loginutils/login.c	2008-03-17 09:04:04 UTC (rev 21353)
@@ -130,9 +130,7 @@
 		fclose(fp);
 	} else
 		puts("\r\nSystem closed for routine maintenance\r");
-	if (!amroot)
-		exit(1);
-	puts("\r\n[Disconnect bypassed -- root login allowed]\r");
+	exit(1);
 }
 #else
 static ALWAYS_INLINE void die_if_nologin(void) {}

Modified: trunk/busybox/miscutils/bbconfig.c
===================================================================
--- trunk/busybox/miscutils/bbconfig.c	2008-03-17 09:02:21 UTC (rev 21352)
+++ trunk/busybox/miscutils/bbconfig.c	2008-03-17 09:04:04 UTC (rev 21353)
@@ -5,7 +5,7 @@
 #include "bbconfigopts.h"
 
 int bbconfig_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int bbconfig_main(int argc, char **argv)
+int bbconfig_main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
 {
 	printf(bbconfig_config);
 	return 0;

Modified: trunk/busybox/miscutils/chat.c
===================================================================
--- trunk/busybox/miscutils/chat.c	2008-03-17 09:02:21 UTC (rev 21352)
+++ trunk/busybox/miscutils/chat.c	2008-03-17 09:04:04 UTC (rev 21353)
@@ -233,7 +233,8 @@
 			//-----------------------
 			// do expect
 			//-----------------------
-			size_t expect_len, buf_len = 0;
+			int expect_len;
+			size_t buf_len = 0;
 			size_t max_len = max_abort_len;
 
 			struct pollfd pfd;
@@ -315,7 +316,7 @@
 				exitcode = ERR_OK;
 
 				// expected reply received? -> goto next command
-				delta = buf_len-expect_len;
+				delta = buf_len - expect_len;
 				if (delta >= 0 && !memcmp(buf+delta, expect, expect_len))
 					goto expect_done;
 #undef buf

Modified: trunk/busybox/modutils/insmod.c
===================================================================
--- trunk/busybox/modutils/insmod.c	2008-03-17 09:02:21 UTC (rev 21352)
+++ trunk/busybox/modutils/insmod.c	2008-03-17 09:04:04 UTC (rev 21353)
@@ -3680,6 +3680,9 @@
  * start of some sections.  this info is used by ksymoops to do better
  * debugging.
  */
+#if !ENABLE_FEATURE_INSMOD_VERSION_CHECKING
+#define get_module_version(f, str) get_module_version(str)
+#endif
 static int
 get_module_version(struct obj_file *f, char str[STRVERSIONLEN])
 {

Modified: trunk/busybox/modutils/lsmod.c
===================================================================
--- trunk/busybox/modutils/lsmod.c	2008-03-17 09:02:21 UTC (rev 21352)
+++ trunk/busybox/modutils/lsmod.c	2008-03-17 09:04:04 UTC (rev 21353)
@@ -75,7 +75,7 @@
 };
 
 int lsmod_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int lsmod_main(int argc, char **argv)
+int lsmod_main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
 {
 	struct module_info info;
 	char *module_names, *mn, *deps, *dn;

Modified: trunk/busybox/networking/Kbuild
===================================================================
--- trunk/busybox/networking/Kbuild	2008-03-17 09:02:21 UTC (rev 21352)
+++ trunk/busybox/networking/Kbuild	2008-03-17 09:04:04 UTC (rev 21353)
@@ -17,7 +17,7 @@
 lib-$(CONFIG_HOSTNAME)     += hostname.o
 lib-$(CONFIG_HTTPD)        += httpd.o
 lib-$(CONFIG_IFCONFIG)     += ifconfig.o interface.o
-lib-$(CONFIG_IFENSLAVE)    += ifenslave.o
+lib-$(CONFIG_IFENSLAVE)    += ifenslave.o interface.o
 lib-$(CONFIG_IFUPDOWN)     += ifupdown.o
 lib-$(CONFIG_INETD)        += inetd.o
 lib-$(CONFIG_IP)           += ip.o

Modified: trunk/busybox/networking/ether-wake.c
===================================================================
--- trunk/busybox/networking/ether-wake.c	2008-03-17 09:02:21 UTC (rev 21352)
+++ trunk/busybox/networking/ether-wake.c	2008-03-17 09:04:04 UTC (rev 21353)
@@ -179,7 +179,7 @@
 }
 
 int ether_wake_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int ether_wake_main(int argc, char **argv)
+int ether_wake_main(int argc ATTRIBUTE_UNUSED, char **argv)
 {
 	const char *ifname = "eth0";
 	char *pass;

Modified: trunk/busybox/networking/httpd.c
===================================================================
--- trunk/busybox/networking/httpd.c	2008-03-17 09:02:21 UTC (rev 21352)
+++ trunk/busybox/networking/httpd.c	2008-03-17 09:04:04 UTC (rev 21353)
@@ -1972,7 +1972,11 @@
 			/* Try and do our best to parse more lines */
 			if ((STRNCASECMP(iobuf, "Content-length:") == 0)) {
 				/* extra read only for POST */
-				if (prequest != request_GET && prequest != request_HEAD) {
+				if (prequest != request_GET
+#if ENABLE_FEATURE_HTTPD_CGI
+				 && prequest != request_HEAD
+#endif
+				) {
 					tptr = iobuf + sizeof("Content-length:") - 1;
 					if (!tptr[0])
 						send_headers_and_exit(HTTP_BAD_REQUEST);
@@ -2129,7 +2133,12 @@
 	 */
 
 	send_file_and_exit(tptr,
-		(prequest != request_HEAD ? SEND_HEADERS_AND_BODY : SEND_HEADERS));
+#if ENABLE_FEATURE_HTTPD_CGI
+		(prequest != request_HEAD ? SEND_HEADERS_AND_BODY : SEND_HEADERS)
+#else
+		SEND_HEADERS_AND_BODY
+#endif
+	);
 }
 
 /*

Modified: trunk/busybox/networking/ifupdown.c
===================================================================
--- trunk/busybox/networking/ifupdown.c	2008-03-17 09:02:21 UTC (rev 21352)
+++ trunk/busybox/networking/ifupdown.c	2008-03-17 09:04:04 UTC (rev 21353)
@@ -483,9 +483,9 @@
 };
 #endif /* ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCPC */
 
+#if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP
 static int dhcp_up(struct interface_defn_t *ifd, execfn *exec)
 {
-#if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP
 	int i;
 #if ENABLE_FEATURE_IFUPDOWN_IP
 	/* ip doesn't up iface when it configures it (unlike ifconfig) */
@@ -498,7 +498,10 @@
 	}
 	bb_error_msg("no dhcp clients found");
 	return 0;
+}
 #elif ENABLE_APP_UDHCPC
+static int dhcp_up(struct interface_defn_t *ifd, execfn *exec)
+{
 #if ENABLE_FEATURE_IFUPDOWN_IP
 	/* ip doesn't up iface when it configures it (unlike ifconfig) */
 	if (!execute("ip link set %iface% up", ifd, exec))
@@ -507,14 +510,18 @@
 	return execute("udhcpc -R -n -p /var/run/udhcpc.%iface%.pid "
 			"-i %iface%[[ -H %hostname%]][[ -c %clientid%]][[ -s %script%]]",
 			ifd, exec);
+}
 #else
+static int dhcp_up(struct interface_defn_t *ifd ATTRIBUTE_UNUSED,
+		execfn *exec ATTRIBUTE_UNUSED)
+{
 	return 0; /* no dhcp support */
+}
 #endif
-}
 
+#if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP
 static int dhcp_down(struct interface_defn_t *ifd, execfn *exec)
 {
-#if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP
 	int i;
 	for (i = 0; i < ARRAY_SIZE(ext_dhcp_clients); i++) {
 		if (exists_execable(ext_dhcp_clients[i].name))
@@ -522,13 +529,20 @@
 	}
 	bb_error_msg("no dhcp clients found, using static interface shutdown");
 	return static_down(ifd, exec);
+}
 #elif ENABLE_APP_UDHCPC
+static int dhcp_down(struct interface_defn_t *ifd, execfn *exec)
+{
 	return execute("kill "
 	               "`cat /var/run/udhcpc.%iface%.pid` 2>/dev/null", ifd, exec);
+}
 #else
+static int dhcp_down(struct interface_defn_t *ifd ATTRIBUTE_UNUSED,
+		execfn *exec ATTRIBUTE_UNUSED)
+{
 	return 0; /* no dhcp support */
+}
 #endif
-}
 
 static int manual_up_down(struct interface_defn_t *ifd ATTRIBUTE_UNUSED, execfn *exec ATTRIBUTE_UNUSED)
 {

Modified: trunk/busybox/networking/inetd.c
===================================================================
--- trunk/busybox/networking/inetd.c	2008-03-17 09:02:21 UTC (rev 21352)
+++ trunk/busybox/networking/inetd.c	2008-03-17 09:04:04 UTC (rev 21353)
@@ -1331,10 +1331,10 @@
 				continue; /* -> check next fd in fd set */
 			}
 
-			/* we are either child or didn't fork at all */
+			/* we are either child or didn't vfork at all */
 #ifdef INETD_BUILTINS_ENABLED
 			if (sep->se_builtin) {
-				if (pid) { /* "pid" is -1: we did fork */
+				if (pid) { /* "pid" is -1: we did vfork */
 					close(sep->se_fd); /* listening socket */
 					logmode = 0; /* make xwrite etc silent */
 				}
@@ -1343,8 +1343,8 @@
 					sep->se_builtin->bi_stream_fn(ctrl, sep);
 				else
 					sep->se_builtin->bi_dgram_fn(ctrl, sep);
-				if (pid) /* we did fork */
-					_exit(0);
+				if (pid) /* we did vfork */
+					_exit(1);
 				maybe_close(accepted_fd);
 				continue; /* -> check next fd in fd set */
 			}
@@ -1430,11 +1430,15 @@
 		xwrite(s, line, sz);
 	}
 #else
+	/* We are after vfork here! */
 	static const char *const args[] = { "cat", NULL };
-	/* no error messages */
+	/* move network socket to stdin */
+	xmove_fd(s, STDIN_FILENO);
+	xdup2(STDIN_FILENO, STDOUT_FILENO);
+	/* no error messages please... */
 	xmove_fd(xopen("/dev/null", O_WRONLY), STDERR_FILENO);
 	BB_EXECVP("cat", (char**)args);
-	_exit(1);
+	/* on failure we return to main, which does exit(1) */
 #endif
 }
 static void echo_dg(int s, servtab_t *sep)
@@ -1463,11 +1467,15 @@
 	while (safe_read(s, line, LINE_SIZE) > 0)
 		continue;
 #else
+	/* We are after vfork here! */
 	static const char *const args[] = { "dd", "of=/dev/null", NULL };
+	/* move network socket to stdin */
+	xmove_fd(s, STDIN_FILENO);
+	xdup2(STDIN_FILENO, STDOUT_FILENO);
 	/* no error messages */
 	xmove_fd(xopen("/dev/null", O_WRONLY), STDERR_FILENO);
 	BB_EXECVP("dd", (char**)args);
-	_exit(1);
+	/* on failure we return to main, which does exit(1) */
 #endif
 }
 /* ARGSUSED */

Modified: trunk/busybox/networking/nc.c
===================================================================
--- trunk/busybox/networking/nc.c	2008-03-17 09:02:21 UTC (rev 21352)
+++ trunk/busybox/networking/nc.c	2008-03-17 09:04:04 UTC (rev 21353)
@@ -17,7 +17,7 @@
  * when compared to "standard" nc
  */
 
-static void timeout(int signum)
+static void timeout(int signum ATTRIBUTE_UNUSED)
 {
 	bb_error_msg_and_die("timed out");
 }

Modified: trunk/busybox/networking/sendmail.c
===================================================================
--- trunk/busybox/networking/sendmail.c	2008-03-17 09:02:21 UTC (rev 21352)
+++ trunk/busybox/networking/sendmail.c	2008-03-17 09:04:04 UTC (rev 21353)
@@ -551,11 +551,11 @@
 			int rc;
 
 			// retrieve message in ./tmp/
-			pop3_check(retr, (const char *)nmsg);
+			pop3_check(retr, (const char *)(ptrdiff_t)nmsg);
 			pop3_message(filename);
 			// delete message from server
 			if (opts & OPTF_z)
-				pop3_check("DELE %u", (const char*)nmsg);
+				pop3_check("DELE %u", (const char*)(ptrdiff_t)nmsg);
 
 			// run postprocessing program
 			if (*fargs) {

Modified: trunk/busybox/networking/telnetd.c
===================================================================
--- trunk/busybox/networking/telnetd.c	2008-03-17 09:02:21 UTC (rev 21352)
+++ trunk/busybox/networking/telnetd.c	2008-03-17 09:04:04 UTC (rev 21353)
@@ -161,14 +161,14 @@
 	const char *login_argv[2];
 	struct termios termbuf;
 	int fd, pid;
-	char tty_name[32];
+	char tty_name[GETPTY_BUFSIZE];
 	struct tsession *ts = xzalloc(sizeof(struct tsession) + BUFSIZE * 2);
 
 	/*ts->buf1 = (char *)(ts + 1);*/
 	/*ts->buf2 = ts->buf1 + BUFSIZE;*/
 
 	/* Got a new connection, set up a tty. */
-	fd = getpty(tty_name, 32);
+	fd = getpty(tty_name);
 	if (fd < 0) {
 		bb_error_msg("can't create pty");
 		return NULL;

Modified: trunk/busybox/networking/traceroute.c
===================================================================
--- trunk/busybox/networking/traceroute.c	2008-03-17 09:02:21 UTC (rev 21352)
+++ trunk/busybox/networking/traceroute.c	2008-03-17 09:04:04 UTC (rev 21353)
@@ -729,6 +729,10 @@
 }
 #endif
 
+#if !ENABLE_FEATURE_TRACEROUTE_VERBOSE
+#define packet_ok(buf, cc, from, seq) \
+	packet_ok(buf, cc, seq)
+#endif
 static int
 packet_ok(unsigned char *buf, int cc, struct sockaddr_in *from, int seq)
 {

Modified: trunk/busybox/networking/udhcp/clientsocket.c
===================================================================
--- trunk/busybox/networking/udhcp/clientsocket.c	2008-03-17 09:02:21 UTC (rev 21352)
+++ trunk/busybox/networking/udhcp/clientsocket.c	2008-03-17 09:04:04 UTC (rev 21353)
@@ -76,7 +76,7 @@
 		BPF_STMT(BPF_LD|BPF_W|BPF_IND, 0),
 		BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, SERVER_AND_CLIENT_PORTS, 0, 1),	/* L3, L4 */
 		/* returns */
-		BPF_STMT(BPF_RET|BPF_K, ~0UL),                          /* L3: pass */
+		BPF_STMT(BPF_RET|BPF_K, (~(uint32_t)0) ),               /* L3: pass */
 		BPF_STMT(BPF_RET|BPF_K, 0),                             /* L4: reject */
 	};
 	static const struct sock_fprog filter_prog = {

Modified: trunk/busybox/networking/wget.c
===================================================================
--- trunk/busybox/networking/wget.c	2008-03-17 09:02:21 UTC (rev 21352)
+++ trunk/busybox/networking/wget.c	2008-03-17 09:04:04 UTC (rev 21353)
@@ -189,7 +189,7 @@
  */
 #else /* FEATURE_WGET_STATUSBAR */
 
-static ALWAYS_INLINE void progressmeter(int flag) { }
+static ALWAYS_INLINE void progressmeter(int flag ATTRIBUTE_UNUSED) { }
 
 #endif
 

Modified: trunk/busybox/procps/ps.c
===================================================================
--- trunk/busybox/procps/ps.c	2008-03-17 09:02:21 UTC (rev 21352)
+++ trunk/busybox/procps/ps.c	2008-03-17 09:04:04 UTC (rev 21353)
@@ -484,7 +484,7 @@
 
 
 int ps_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int ps_main(int argc, char **argv)
+int ps_main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
 {
 	procps_status_t *p = NULL;
 	int len;

Modified: trunk/busybox/shell/ash.c
===================================================================
--- trunk/busybox/shell/ash.c	2008-03-17 09:02:21 UTC (rev 21352)
+++ trunk/busybox/shell/ash.c	2008-03-17 09:04:04 UTC (rev 21353)
@@ -3247,6 +3247,9 @@
 static smallint job_warning;    /* user was warned about stopped jobs (can be 2, 1 or 0). */
 
 static struct job *makejob(/*union node *,*/ int);
+#if !JOBS
+#define forkshell(job, node, mode) forkshell(job, mode)
+#endif
 static int forkshell(struct job *, union node *, int);
 static int waitforjob(struct job *);
 
@@ -3424,6 +3427,9 @@
 /*
  * Convert a job name to a job structure.
  */
+#if !JOBS
+#define getjob(name, getctl) getjob(name)
+#endif
 static struct job *
 getjob(const char *name, int getctl)
 {
@@ -4533,6 +4539,9 @@
 }
 
 /* Called after fork(), in parent */
+#if !JOBS
+#define forkparent(jp, n, mode, pid) forkparent(jp, mode, pid)
+#endif
 static void
 forkparent(struct job *jp, union node *n, int mode, pid_t pid)
 {
@@ -8674,8 +8683,8 @@
 	char *buf =  parsefile->buf;
 	parsenextc = buf;
 
+#if ENABLE_FEATURE_EDITING
  retry:
-#if ENABLE_FEATURE_EDITING
 	if (!iflag || parsefile->fd)
 		nr = nonblock_safe_read(parsefile->fd, buf, BUFSIZ - 1);
 	else {
@@ -8876,8 +8885,11 @@
  * Push a string back onto the input at this current parsefile level.
  * We handle aliases this way.
  */
+#if !ENABLE_ASH_ALIAS
+#define pushstring(s, ap) pushstring(s)
+#endif
 static void
-pushstring(char *s, void *ap)
+pushstring(char *s, struct alias *ap)
 {
 	struct strpush *sp;
 	size_t len;
@@ -8894,9 +8906,9 @@
 	sp->prevstring = parsenextc;
 	sp->prevnleft = parsenleft;
 #if ENABLE_ASH_ALIAS
-	sp->ap = (struct alias *)ap;
+	sp->ap = ap;
 	if (ap) {
-		((struct alias *)ap)->flag |= ALIASINUSE;
+		ap->flag |= ALIASINUSE;
 		sp->string = s;
 	}
 #endif

Modified: trunk/busybox/shell/cttyhack.c
===================================================================
--- trunk/busybox/shell/cttyhack.c	2008-03-17 09:02:21 UTC (rev 21352)
+++ trunk/busybox/shell/cttyhack.c	2008-03-17 09:04:04 UTC (rev 21353)
@@ -38,7 +38,7 @@
 };
 
 int cttyhack_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int cttyhack_main(int argc, char **argv)
+int cttyhack_main(int argc ATTRIBUTE_UNUSED, char **argv)
 {
 	int fd;
 	char console[sizeof(int)*3 + 16];

Modified: trunk/busybox/util-linux/fbset.c
===================================================================
--- trunk/busybox/util-linux/fbset.c	2008-03-17 09:02:21 UTC (rev 21352)
+++ trunk/busybox/util-linux/fbset.c	2008-03-17 09:04:04 UTC (rev 21353)
@@ -170,10 +170,10 @@
 };
 #endif
 
+#if ENABLE_FEATURE_FBSET_READMODE
 static int readmode(struct fb_var_screeninfo *base, const char *fn,
 					const char *mode)
 {
-#if ENABLE_FEATURE_FBSET_READMODE
 	FILE *f;
 	char buf[256];
 	char *p = buf;
@@ -257,11 +257,9 @@
 				return 1;
 		}
 	}
-#else
-	bb_error_msg("mode reading not compiled in");
-#endif
 	return 0;
 }
+#endif
 
 static inline void setmode(struct fb_var_screeninfo *base,
 					struct fb_var_screeninfo *set)
@@ -389,9 +387,13 @@
 	fh = xopen(fbdev, O_RDONLY);
 	xioctl(fh, FBIOGET_VSCREENINFO, &var);
 	if (g_options & OPT_READMODE) {
+#if !ENABLE_FEATURE_FBSET_READMODE
+		bb_show_usage();
+#else
 		if (!readmode(&var, modefile, mode)) {
 			bb_error_msg_and_die("unknown video mode '%s'", mode);
 		}
+#endif
 	}
 
 	setmode(&var, &varset);

Modified: trunk/busybox/util-linux/fdisk.c
===================================================================
--- trunk/busybox/util-linux/fdisk.c	2008-03-17 09:02:21 UTC (rev 21352)
+++ trunk/busybox/util-linux/fdisk.c	2008-03-17 09:04:04 UTC (rev 21353)
@@ -128,7 +128,11 @@
 #endif
 static const char *partition_type(unsigned char type);
 static void get_geometry(void);
+#if ENABLE_FEATURE_SUN_LABEL || ENABLE_FEATURE_FDISK_WRITABLE
 static int get_boot(enum action what);
+#else
+static int get_boot(void);
+#endif
 
 #define PLURAL   0
 #define SINGULAR 1
@@ -1237,8 +1241,12 @@
  *    0: found or created label
  *    1: I/O error
  */
-static int
-get_boot(enum action what)
+#if ENABLE_FEATURE_SUN_LABEL || ENABLE_FEATURE_FDISK_WRITABLE
+static int get_boot(enum action what)
+#else
+static int get_boot(void)
+#define get_boot(what) get_boot()
+#endif
 {
 	int i;
 

Modified: trunk/busybox/util-linux/script.c
===================================================================
--- trunk/busybox/util-linux/script.c	2008-03-17 09:02:21 UTC (rev 21352)
+++ trunk/busybox/util-linux/script.c	2008-03-17 09:04:04 UTC (rev 21353)
@@ -29,7 +29,7 @@
 	int attr_ok; /* NB: 0: ok */
 	int winsz_ok;
 	int pty;
-	char pty_line[32];
+	char pty_line[GETPTY_BUFSIZE];
 	struct termios tt, rtt;
 	struct winsize win;
 	const char *fname = "typescript";
@@ -69,7 +69,7 @@
 		shell = DEFAULT_SHELL;
 	}
 
-	pty = getpty(pty_line, sizeof(pty_line));
+	pty = getpty(pty_line);
 	if (pty < 0) {
 		bb_perror_msg_and_die("can't get pty");
 	}

Modified: trunk/busybox/util-linux/volume_id/get_devname.c
===================================================================
--- trunk/busybox/util-linux/volume_id/get_devname.c	2008-03-17 09:02:21 UTC (rev 21352)
+++ trunk/busybox/util-linux/volume_id/get_devname.c	2008-03-17 09:04:04 UTC (rev 21353)
@@ -26,6 +26,10 @@
 } *uuidCache;
 
 /* for now, only ext2, ext3 and xfs are supported */
+#if !ENABLE_FEATURE_VOLUMEID_ISO9660
+#define get_label_uuid(device, label, uuid, iso_only) \
+	get_label_uuid(device, label, uuid)
+#endif
 static int
 get_label_uuid(const char *device, char **label, char **uuid, int iso_only)
 {
@@ -83,6 +87,10 @@
 	memcpy(last->uuid, uuid, sizeof(last->uuid));
 }
 
+#if !ENABLE_FEATURE_VOLUMEID_ISO9660
+#define uuidcache_check_device(device_name, ma, mi, iso_only) \
+	uuidcache_check_device(device_name, ma, mi)
+#endif
 static void
 uuidcache_check_device(const char *device_name, int ma, int mi, int iso_only)
 {




More information about the busybox-cvs mailing list