diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-03-17 09:04:04 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-03-17 09:04:04 +0000 |
commit | 85c247161b9e1e7c71ebcb874ed7b6a23b6a5b50 (patch) | |
tree | 0b60f25ea0ebfbac5d9b3fa22f123aadaecd6663 /networking/inetd.c | |
parent | 081eb71ebd7954a67287816a9a6fff80e8c5319a (diff) | |
download | busybox-w32-85c247161b9e1e7c71ebcb874ed7b6a23b6a5b50.tar.gz busybox-w32-85c247161b9e1e7c71ebcb874ed7b6a23b6a5b50.tar.bz2 busybox-w32-85c247161b9e1e7c71ebcb874ed7b6a23b6a5b50.zip |
*: 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
Diffstat (limited to 'networking/inetd.c')
-rw-r--r-- | networking/inetd.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/networking/inetd.c b/networking/inetd.c index 0ddfa6b45..b931aa1e0 100644 --- a/networking/inetd.c +++ b/networking/inetd.c | |||
@@ -1331,10 +1331,10 @@ int inetd_main(int argc ATTRIBUTE_UNUSED, char **argv) | |||
1331 | continue; /* -> check next fd in fd set */ | 1331 | continue; /* -> check next fd in fd set */ |
1332 | } | 1332 | } |
1333 | 1333 | ||
1334 | /* we are either child or didn't fork at all */ | 1334 | /* we are either child or didn't vfork at all */ |
1335 | #ifdef INETD_BUILTINS_ENABLED | 1335 | #ifdef INETD_BUILTINS_ENABLED |
1336 | if (sep->se_builtin) { | 1336 | if (sep->se_builtin) { |
1337 | if (pid) { /* "pid" is -1: we did fork */ | 1337 | if (pid) { /* "pid" is -1: we did vfork */ |
1338 | close(sep->se_fd); /* listening socket */ | 1338 | close(sep->se_fd); /* listening socket */ |
1339 | logmode = 0; /* make xwrite etc silent */ | 1339 | logmode = 0; /* make xwrite etc silent */ |
1340 | } | 1340 | } |
@@ -1343,8 +1343,8 @@ int inetd_main(int argc ATTRIBUTE_UNUSED, char **argv) | |||
1343 | sep->se_builtin->bi_stream_fn(ctrl, sep); | 1343 | sep->se_builtin->bi_stream_fn(ctrl, sep); |
1344 | else | 1344 | else |
1345 | sep->se_builtin->bi_dgram_fn(ctrl, sep); | 1345 | sep->se_builtin->bi_dgram_fn(ctrl, sep); |
1346 | if (pid) /* we did fork */ | 1346 | if (pid) /* we did vfork */ |
1347 | _exit(0); | 1347 | _exit(1); |
1348 | maybe_close(accepted_fd); | 1348 | maybe_close(accepted_fd); |
1349 | continue; /* -> check next fd in fd set */ | 1349 | continue; /* -> check next fd in fd set */ |
1350 | } | 1350 | } |
@@ -1430,11 +1430,15 @@ static void echo_stream(int s, servtab_t *sep ATTRIBUTE_UNUSED) | |||
1430 | xwrite(s, line, sz); | 1430 | xwrite(s, line, sz); |
1431 | } | 1431 | } |
1432 | #else | 1432 | #else |
1433 | /* We are after vfork here! */ | ||
1433 | static const char *const args[] = { "cat", NULL }; | 1434 | static const char *const args[] = { "cat", NULL }; |
1434 | /* no error messages */ | 1435 | /* move network socket to stdin */ |
1436 | xmove_fd(s, STDIN_FILENO); | ||
1437 | xdup2(STDIN_FILENO, STDOUT_FILENO); | ||
1438 | /* no error messages please... */ | ||
1435 | xmove_fd(xopen("/dev/null", O_WRONLY), STDERR_FILENO); | 1439 | xmove_fd(xopen("/dev/null", O_WRONLY), STDERR_FILENO); |
1436 | BB_EXECVP("cat", (char**)args); | 1440 | BB_EXECVP("cat", (char**)args); |
1437 | _exit(1); | 1441 | /* on failure we return to main, which does exit(1) */ |
1438 | #endif | 1442 | #endif |
1439 | } | 1443 | } |
1440 | static void echo_dg(int s, servtab_t *sep) | 1444 | static void echo_dg(int s, servtab_t *sep) |
@@ -1463,11 +1467,15 @@ static void discard_stream(int s, servtab_t *sep ATTRIBUTE_UNUSED) | |||
1463 | while (safe_read(s, line, LINE_SIZE) > 0) | 1467 | while (safe_read(s, line, LINE_SIZE) > 0) |
1464 | continue; | 1468 | continue; |
1465 | #else | 1469 | #else |
1470 | /* We are after vfork here! */ | ||
1466 | static const char *const args[] = { "dd", "of=/dev/null", NULL }; | 1471 | static const char *const args[] = { "dd", "of=/dev/null", NULL }; |
1472 | /* move network socket to stdin */ | ||
1473 | xmove_fd(s, STDIN_FILENO); | ||
1474 | xdup2(STDIN_FILENO, STDOUT_FILENO); | ||
1467 | /* no error messages */ | 1475 | /* no error messages */ |
1468 | xmove_fd(xopen("/dev/null", O_WRONLY), STDERR_FILENO); | 1476 | xmove_fd(xopen("/dev/null", O_WRONLY), STDERR_FILENO); |
1469 | BB_EXECVP("dd", (char**)args); | 1477 | BB_EXECVP("dd", (char**)args); |
1470 | _exit(1); | 1478 | /* on failure we return to main, which does exit(1) */ |
1471 | #endif | 1479 | #endif |
1472 | } | 1480 | } |
1473 | /* ARGSUSED */ | 1481 | /* ARGSUSED */ |