summaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorDenis Vlasenko2008-02-24 13:36:01 +0000
committerDenis Vlasenko2008-02-24 13:36:01 +0000
commit400d8bb45ee25ce226bb343a3dfaab84e6d3a8e1 (patch)
treeaa3cdc9a663f1ac2467803fc215899d86ed1db74 /networking
parentd553faf5a53cf9d72e16fc789451a92a797f1b70 (diff)
downloadbusybox-400d8bb45ee25ce226bb343a3dfaab84e6d3a8e1.zip
busybox-400d8bb45ee25ce226bb343a3dfaab84e6d3a8e1.tar.gz
less,klogd,syslogd,nc,tcpudp: exit on signal by killing itself, not exit(1)
*: minor shrink
Diffstat (limited to 'networking')
-rw-r--r--networking/inetd.c2
-rw-r--r--networking/nc_bloaty.c2
-rw-r--r--networking/slattach.c8
3 files changed, 6 insertions, 6 deletions
diff --git a/networking/inetd.c b/networking/inetd.c
index a7259f3..fd865ef 100644
--- a/networking/inetd.c
+++ b/networking/inetd.c
@@ -1327,7 +1327,7 @@ int inetd_main(int argc, char **argv)
}
memset((char *) &sa, 0, sizeof(sa));
- sigemptyset(&sa.sa_mask);
+ /*sigemptyset(&sa.sa_mask); - memset did it */
sigaddset(&sa.sa_mask, SIGALRM);
sigaddset(&sa.sa_mask, SIGCHLD);
sigaddset(&sa.sa_mask, SIGHUP);
diff --git a/networking/nc_bloaty.c b/networking/nc_bloaty.c
index 853577a..dd62e5d 100644
--- a/networking/nc_bloaty.c
+++ b/networking/nc_bloaty.c
@@ -163,7 +163,7 @@ static void catch(int sig)
if (o_verbose > 1) /* normally we don't care */
fprintf(stderr, SENT_N_RECV_M, wrote_net, wrote_out);
fprintf(stderr, "punt!\n");
- exit(1);
+ kill_myself_with_sig(sig);
}
/* unarm */
diff --git a/networking/slattach.c b/networking/slattach.c
index e501d82..1987eb3 100644
--- a/networking/slattach.c
+++ b/networking/slattach.c
@@ -43,7 +43,7 @@ static void save_state(void)
xioctl(handle, TIOCGETD, &saved_disc);
}
-static int set_termios_state_and_warn(struct termios *state)
+static int set_termios_state_or_warn(struct termios *state)
{
int ret;
@@ -78,12 +78,12 @@ static void restore_state_and_exit(int exitcode)
memcpy(&state, &saved_state, sizeof(state));
cfsetispeed(&state, B0);
cfsetospeed(&state, B0);
- if (set_termios_state_and_warn(&state))
+ if (set_termios_state_or_warn(&state))
exitcode = 1;
sleep(1);
/* Restore line status */
- if (set_termios_state_and_warn(&saved_state))
+ if (set_termios_state_or_warn(&saved_state))
exit(EXIT_FAILURE);
if (ENABLE_FEATURE_CLEAN_UP)
close(handle);
@@ -99,7 +99,7 @@ static void set_state(struct termios *state, int encap)
int disc;
/* Set line status */
- if (set_termios_state_and_warn(state))
+ if (set_termios_state_or_warn(state))
goto bad;
/* Set line discliple (N_SLIP always) */
disc = N_SLIP;