From 86981e3ad2d03e77d1f668ac1603a041be448dae Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 25 Jul 2017 20:06:17 +0200 Subject: ash: allow "trap NUM [SIG]..." syntax While at it, make get_signum() return -1 for numeric strings >= NSIG. function old new delta trapcmd 292 306 +14 get_signum 295 300 +5 builtin_trap 413 412 -1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/1 up/down: 19/-1) Total: 18 bytes Signed-off-by: Denys Vlasenko --- procps/kill.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'procps') diff --git a/procps/kill.c b/procps/kill.c index 5cff24475..09beefb2d 100644 --- a/procps/kill.c +++ b/procps/kill.c @@ -188,7 +188,7 @@ int kill_main(int argc UNUSED_PARAM, char **argv) arg = *++argv; } /* else it must be -SIG */ signo = get_signum(arg); - if (signo < 0) { /* || signo > MAX_SIGNUM ? */ + if (signo < 0) { bb_error_msg("bad signal name '%s'", arg); return EXIT_FAILURE; } -- cgit v1.2.3