ash,hush: fix trap reporting: s/SIGEXIT/EXIT/
authorDenys Vlasenko <vda.linux@googlemail.com>
Wed, 23 Sep 2009 23:43:21 +0000 (01:43 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Wed, 23 Sep 2009 23:43:21 +0000 (01:43 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
shell/ash.c
shell/hush.c
shell/hush_test/hush-trap/usage.right

index b7c6431952cdf55f2c09087d091b0738c9622f0b..597bc2808b1c86546d53086850de7588067038a9 100644 (file)
@@ -12259,8 +12259,9 @@ trapcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
        if (!*ap) {
                for (signo = 0; signo < NSIG; signo++) {
                        if (trap[signo] != NULL) {
-                               out1fmt("trap -- %s SIG%s\n",
+                               out1fmt("trap -- %s %s%s\n",
                                                single_quote(trap[signo]),
+                                               (signo == 0 ? "" : "SIG"),
                                                get_signame(signo));
                        }
                }
index 9db2091ddf51c3889511057b9f319fda34daf172..85a45dd6bf1aa93bb860b96b5534a78aea5624b4 100644 (file)
@@ -7099,7 +7099,7 @@ static int FAST_FUNC builtin_trap(char **argv)
                                printf("trap -- ");
                                print_escaped(G.traps[i]);
                                /* bash compat: it says SIGxxx, not just xxx */
-                               printf(" SIG%s\n", get_signame(i));
+                               printf(" %s%s\n", i == 0 ? "" : "SIG", get_signame(i));
                        }
                }
                /*fflush(stdout); - done after each builtin anyway */
index c0dbd6c3c82533938cd122088e874d5eff01c769..5b90222f878fe71746f66e4dd72269ebcf946fe9 100644 (file)
@@ -2,13 +2,13 @@ ___
 ___
 ___
 trap -- 'a' EXIT
-trap -- 'a' INT
-trap -- 'a' USR1
-trap -- 'a' USR2
+trap -- 'a' SIGINT
+trap -- 'a' SIGUSR1
+trap -- 'a' SIGUSR2
 ___
 ___
-trap -- 'a' USR1
-trap -- 'a' USR2
+trap -- 'a' SIGUSR1
+trap -- 'a' SIGUSR2
 ___
 ___
-trap -- 'a' USR2
+trap -- 'a' SIGUSR2