aboutsummaryrefslogtreecommitdiff
path: root/ipsvd/tcpsvd.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-04-03 01:13:04 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-04-03 01:13:04 +0000
commit992e05b6f070562d83f9238b227e1ddbf951c9af (patch)
treec64729c60f929f3007b4ed93543291b52cb50a02 /ipsvd/tcpsvd.c
parentcea0a8bccbb0d98eb0e7423e6fff0d8529db8efe (diff)
downloadbusybox-992e05b6f070562d83f9238b227e1ddbf951c9af.tar.gz
udpsvd: more work on it. works in limited testing.
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)
if (!argv[0][0] || LONE_CHAR(argv[0], '0'))
argv[0] = (char*)"0.0.0.0";
+ /* stdout is used for logging, don't buffer */
setlinebuf(stdout);
+ bb_sanitize_stdio(); /* fd# 1,2 must be opened */
+
need_hostnames = verbose || !(option_mask32 & OPT_E);
need_remote_ip = max_per_host || need_hostnames;
@@ -232,7 +235,6 @@ int tcpsvd_main(int argc, char **argv)
xsetuid(ugid.uid);
}
#endif
- bb_sanitize_stdio(); /* fd# 1,2 must be opened */
close(0);
if (verbose) {
@@ -439,6 +441,7 @@ int tcpsvd_main(int argc, char **argv)
xmove_fd(conn, 0);
dup2(0, 1);
+
signal(SIGTERM, SIG_DFL);
signal(SIGPIPE, SIG_DFL);
signal(SIGCHLD, SIG_DFL);