*: 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
This commit is contained in:
+1
-1
@@ -17,7 +17,7 @@ lib-$(CONFIG_FTPPUT) += ftpgetput.o
|
||||
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
|
||||
|
||||
@@ -179,7 +179,7 @@ static int get_wol_pw(const char *ethoptarg, unsigned char *wol_passwd)
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
+11
-2
@@ -1972,7 +1972,11 @@ static void handle_incoming_and_exit(const len_and_sockaddr *fromAddr)
|
||||
/* 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 @@ static void handle_incoming_and_exit(const len_and_sockaddr *fromAddr)
|
||||
*/
|
||||
|
||||
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
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+22
-8
@@ -483,9 +483,9 @@ static const struct dhcp_client_t ext_dhcp_clients[] = {
|
||||
};
|
||||
#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 @@ static int dhcp_up(struct interface_defn_t *ifd, execfn *exec)
|
||||
}
|
||||
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 @@ static int dhcp_up(struct interface_defn_t *ifd, execfn *exec)
|
||||
return execute("udhcpc -R -n -p /var/run/udhcpc.%iface%.pid "
|
||||
"-i %iface%[[ -H %hostname%]][[ -c %clientid%]][[ -s %script%]]",
|
||||
ifd, exec);
|
||||
#else
|
||||
return 0; /* no dhcp support */
|
||||
#endif
|
||||
}
|
||||
#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 @@ static int dhcp_down(struct interface_defn_t *ifd, execfn *exec)
|
||||
}
|
||||
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
|
||||
return 0; /* no dhcp support */
|
||||
#endif
|
||||
}
|
||||
#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)
|
||||
{
|
||||
|
||||
+15
-7
@@ -1331,10 +1331,10 @@ int inetd_main(int argc ATTRIBUTE_UNUSED, char **argv)
|
||||
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 @@ int inetd_main(int argc ATTRIBUTE_UNUSED, char **argv)
|
||||
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 @@ static void echo_stream(int s, servtab_t *sep ATTRIBUTE_UNUSED)
|
||||
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 @@ static void discard_stream(int s, servtab_t *sep ATTRIBUTE_UNUSED)
|
||||
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 */
|
||||
|
||||
+1
-1
@@ -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");
|
||||
}
|
||||
|
||||
@@ -551,11 +551,11 @@ int sendgetmail_main(int argc ATTRIBUTE_UNUSED, char **argv)
|
||||
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) {
|
||||
|
||||
@@ -161,14 +161,14 @@ make_new_session(
|
||||
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;
|
||||
|
||||
@@ -729,6 +729,10 @@ pr_type(unsigned char t)
|
||||
}
|
||||
#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)
|
||||
{
|
||||
|
||||
@@ -76,7 +76,7 @@ int raw_socket(int ifindex)
|
||||
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 = {
|
||||
|
||||
+1
-1
@@ -189,7 +189,7 @@ static void progressmeter(int flag)
|
||||
*/
|
||||
#else /* FEATURE_WGET_STATUSBAR */
|
||||
|
||||
static ALWAYS_INLINE void progressmeter(int flag) { }
|
||||
static ALWAYS_INLINE void progressmeter(int flag ATTRIBUTE_UNUSED) { }
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user