diff options
author | Denis Vlasenko | 2008-02-24 13:36:01 +0000 |
---|---|---|
committer | Denis Vlasenko | 2008-02-24 13:36:01 +0000 |
commit | 400d8bb45ee25ce226bb343a3dfaab84e6d3a8e1 (patch) | |
tree | aa3cdc9a663f1ac2467803fc215899d86ed1db74 /networking/slattach.c | |
parent | d553faf5a53cf9d72e16fc789451a92a797f1b70 (diff) | |
download | busybox-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/slattach.c')
-rw-r--r-- | networking/slattach.c | 8 |
1 files changed, 4 insertions, 4 deletions
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; |