diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-09-27 02:05:45 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-09-27 02:05:45 +0200 |
commit | e74aaf93854b9453b9949954aec77710b257d8b6 (patch) | |
tree | 0be4c4457b9567427706871bfb62fafa296eca19 /shell/ash.c | |
parent | 6c750f15180ba51ef37c6cfa381b52e6b05d55aa (diff) | |
download | busybox-w32-e74aaf93854b9453b9949954aec77710b257d8b6.tar.gz busybox-w32-e74aaf93854b9453b9949954aec77710b257d8b6.tar.bz2 busybox-w32-e74aaf93854b9453b9949954aec77710b257d8b6.zip |
ash,hush: make trap output short signal names, without SIG prefix
function old new delta
evalvar 1373 1371 -2
builtin_trap 457 441 -16
trapcmd 260 236 -24
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/ash.c')
-rw-r--r-- | shell/ash.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/shell/ash.c b/shell/ash.c index c909cae2b..d7355ce81 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -12267,13 +12267,16 @@ trapcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) | |||
12267 | for (signo = 0; signo < NSIG; signo++) { | 12267 | for (signo = 0; signo < NSIG; signo++) { |
12268 | char *tr = trap_ptr[signo]; | 12268 | char *tr = trap_ptr[signo]; |
12269 | if (tr) { | 12269 | if (tr) { |
12270 | out1fmt("trap -- %s %s%s\n", | 12270 | /* note: bash adds "SIG", but only if invoked |
12271 | * as "bash". If called as "sh", or if set -o posix, | ||
12272 | * then it prints short signal names. | ||
12273 | * We are printing short names: */ | ||
12274 | out1fmt("trap -- %s %s\n", | ||
12271 | single_quote(tr), | 12275 | single_quote(tr), |
12272 | (signo == 0 ? "" : "SIG"), | ||
12273 | get_signame(signo)); | 12276 | get_signame(signo)); |
12274 | /* trap_ptr != trap only if we are in special-cased `trap` code. | 12277 | /* trap_ptr != trap only if we are in special-cased `trap` code. |
12275 | * In this case, we will exit very soon, no need to free(). */ | 12278 | * In this case, we will exit very soon, no need to free(). */ |
12276 | /* if (trap_ptr != trap) */ | 12279 | /* if (trap_ptr != trap && tp[0]) */ |
12277 | /* free(tr); */ | 12280 | /* free(tr); */ |
12278 | } | 12281 | } |
12279 | } | 12282 | } |