aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-06-05 15:35:36 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2009-06-05 15:35:36 +0200
commit0f952c249e30834a3ee5cd821e9afc3197b05f9c (patch)
tree360a2a97bf49a736d6fd9c9eebd2b6c64b5023f4
parent53f17912120e2f8732443fbb91fcf2c87123eaa5 (diff)
downloadbusybox-w32-0f952c249e30834a3ee5cd821e9afc3197b05f9c.tar.gz
busybox-w32-0f952c249e30834a3ee5cd821e9afc3197b05f9c.tar.bz2
busybox-w32-0f952c249e30834a3ee5cd821e9afc3197b05f9c.zip
inetd: comment why we redirect stderr to network
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--networking/inetd.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/networking/inetd.c b/networking/inetd.c
index 031edc397..331c49441 100644
--- a/networking/inetd.c
+++ b/networking/inetd.c
@@ -1356,9 +1356,12 @@ int inetd_main(int argc UNUSED_PARAM, char **argv)
1356 if (setrlimit(RLIMIT_NOFILE, &rlim_ofile) < 0) 1356 if (setrlimit(RLIMIT_NOFILE, &rlim_ofile) < 0)
1357 bb_perror_msg("setrlimit"); 1357 bb_perror_msg("setrlimit");
1358 closelog(); 1358 closelog();
1359 xmove_fd(ctrl, 0); 1359 xmove_fd(ctrl, STDIN_FILENO);
1360 xdup2(0, 1); 1360 xdup2(STDIN_FILENO, STDOUT_FILENO);
1361 xdup2(0, 2); 1361 /* manpages of inetd I managed to find either say
1362 * that stderr is also redirected to the network,
1363 * or do not talk about redirection at all (!) */
1364 xdup2(STDIN_FILENO, STDERR_FILENO);
1362 /* NB: among others, this loop closes listening socket 1365 /* NB: among others, this loop closes listening socket
1363 * for nowait stream children */ 1366 * for nowait stream children */
1364 for (sep2 = serv_list; sep2; sep2 = sep2->se_next) 1367 for (sep2 = serv_list; sep2; sep2 = sep2->se_next)