summaryrefslogtreecommitdiff
path: root/ipsvd/tcpsvd.c
diff options
context:
space:
mode:
Diffstat (limited to 'ipsvd/tcpsvd.c')
-rw-r--r--ipsvd/tcpsvd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ipsvd/tcpsvd.c b/ipsvd/tcpsvd.c
index 98234a78b..056deff33 100644
--- a/ipsvd/tcpsvd.c
+++ b/ipsvd/tcpsvd.c
@@ -179,7 +179,10 @@ int tcpsvd_main(int argc, char **argv)
179 if (!argv[0][0] || LONE_CHAR(argv[0], '0')) 179 if (!argv[0][0] || LONE_CHAR(argv[0], '0'))
180 argv[0] = (char*)"0.0.0.0"; 180 argv[0] = (char*)"0.0.0.0";
181 181
182 /* stdout is used for logging, don't buffer */
182 setlinebuf(stdout); 183 setlinebuf(stdout);
184 bb_sanitize_stdio(); /* fd# 1,2 must be opened */
185
183 need_hostnames = verbose || !(option_mask32 & OPT_E); 186 need_hostnames = verbose || !(option_mask32 & OPT_E);
184 need_remote_ip = max_per_host || need_hostnames; 187 need_remote_ip = max_per_host || need_hostnames;
185 188
@@ -232,7 +235,6 @@ int tcpsvd_main(int argc, char **argv)
232 xsetuid(ugid.uid); 235 xsetuid(ugid.uid);
233 } 236 }
234#endif 237#endif
235 bb_sanitize_stdio(); /* fd# 1,2 must be opened */
236 close(0); 238 close(0);
237 239
238 if (verbose) { 240 if (verbose) {
@@ -439,6 +441,7 @@ int tcpsvd_main(int argc, char **argv)
439 441
440 xmove_fd(conn, 0); 442 xmove_fd(conn, 0);
441 dup2(0, 1); 443 dup2(0, 1);
444
442 signal(SIGTERM, SIG_DFL); 445 signal(SIGTERM, SIG_DFL);
443 signal(SIGPIPE, SIG_DFL); 446 signal(SIGPIPE, SIG_DFL);
444 signal(SIGCHLD, SIG_DFL); 447 signal(SIGCHLD, SIG_DFL);