diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-02-24 16:36:01 +0300 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-02-24 16:36:01 +0300 |
commit | 400d8bb45ee25ce226bb343a3dfaab84e6d3a8e1 (patch) | |
tree | aa3cdc9a663f1ac2467803fc215899d86ed1db74 /coreutils | |
parent | d553faf5a53cf9d72e16fc789451a92a797f1b70 (diff) |
less,klogd,syslogd,nc,tcpudp: exit on signal by killing itself, not exit(1)
*: minor shrink
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/dd.c | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/coreutils/dd.c b/coreutils/dd.c index 7552c8518..961b1fff7 100644 --- a/coreutils/dd.c +++ b/coreutils/dd.c @@ -141,7 +141,7 @@ int dd_main(int argc, char **argv) #if ENABLE_FEATURE_DD_SIGNAL_HANDLING sigact.sa_handler = dd_output_status; sigact.sa_flags = SA_RESTART; - sigemptyset(&sigact.sa_mask); + /*sigemptyset(&sigact.sa_mask); - memset did it */ sigaction(SIGUSR1, &sigact, NULL); #endif @@ -164,40 +164,40 @@ int dd_main(int argc, char **argv) if (what == 0) bb_show_usage(); arg += key_len; - /* Must fit into positive ssize_t */ #if ENABLE_FEATURE_DD_IBS_OBS - if (what == OP_ibs) { - ibs = xatoul_range_sfx(arg, 1, ((size_t)-1L)/2, dd_suffixes); - continue; - } - if (what == OP_obs) { - obs = xatoul_range_sfx(arg, 1, ((size_t)-1L)/2, dd_suffixes); - continue; - } - if (what == OP_conv) { - while (1) { - /* find ',', replace them with nil so we can use arg for - * index_in_strings() without copying. - * We rely on arg being non-null, else strchr would fault. - */ - key = strchr(arg, ','); - if (key) - *key = '\0'; - what = index_in_strings(keywords, arg) + 1; - if (what < OP_conv_notrunc) - bb_error_msg_and_die(bb_msg_invalid_arg, arg, "conv"); - if (what == OP_conv_notrunc) - flags |= FLAG_NOTRUNC; - if (what == OP_conv_sync) - flags |= FLAG_SYNC; - if (what == OP_conv_noerror) - flags |= FLAG_NOERROR; - if (!key) /* no ',' left, so this was the last specifier */ - break; - arg = key + 1; /* skip this keyword and ',' */ - } - continue; + if (what == OP_ibs) { + /* Must fit into positive ssize_t */ + ibs = xatoul_range_sfx(arg, 1, ((size_t)-1L)/2, dd_suffixes); + continue; + } + if (what == OP_obs) { + obs = xatoul_range_sfx(arg, 1, ((size_t)-1L)/2, dd_suffixes); + continue; + } + if (what == OP_conv) { + while (1) { + /* find ',', replace them with NUL so we can use arg for + * index_in_strings() without copying. + * We rely on arg being non-null, else strchr would fault. + */ + key = strchr(arg, ','); + if (key) + *key = '\0'; + what = index_in_strings(keywords, arg) + 1; + if (what < OP_conv_notrunc) + bb_error_msg_and_die(bb_msg_invalid_arg, arg, "conv"); + if (what == OP_conv_notrunc) + flags |= FLAG_NOTRUNC; + if (what == OP_conv_sync) + flags |= FLAG_SYNC; + if (what == OP_conv_noerror) + flags |= FLAG_NOERROR; + if (!key) /* no ',' left, so this was the last specifier */ + break; + arg = key + 1; /* skip this keyword and ',' */ } + continue; + } #endif if (what == OP_bs) { ibs = obs = xatoul_range_sfx(arg, 1, ((size_t)-1L)/2, dd_suffixes); |