aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2009-04-18 13:05:10 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2009-04-18 13:05:10 +0000
commit6008d8a3cc80c1d758f99ed1229ca2b9bcd4c3b1 (patch)
tree8373fd30800d5764e46f5c5b558861283fe5f372
parent38e626df4ddac2426afb336d2e1794913c022c15 (diff)
downloadbusybox-6008d8a3cc80c1d758f99ed1229ca2b9bcd4c3b1.tar.gz
hush: fix thinko in error msg
-rw-r--r--shell/hush.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 6e181ce99..56a289777 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -6430,7 +6430,6 @@ static int builtin_export(char **argv)
static int builtin_trap(char **argv)
{
- int i;
int sig;
char *new_cmd;
@@ -6439,6 +6438,7 @@ static int builtin_trap(char **argv)
argv++;
if (!*argv) {
+ int i;
/* No args: print all trapped */
for (i = 0; i < NSIG; ++i) {
if (G.traps[i]) {
@@ -6452,7 +6452,6 @@ static int builtin_trap(char **argv)
}
new_cmd = NULL;
- i = 0;
/* If first arg is a number: reset all specified signals */
sig = bb_strtou(*argv, NULL, 10);
if (errno == 0) {
@@ -6464,7 +6463,7 @@ static int builtin_trap(char **argv)
if (sig < 0 || sig >= NSIG) {
ret = EXIT_FAILURE;
/* Mimic bash message exactly */
- bb_perror_msg("trap: %s: invalid signal specification", argv[i]);
+ bb_perror_msg("trap: %s: invalid signal specification", argv[-1]);
continue;
}
@@ -6488,8 +6487,8 @@ static int builtin_trap(char **argv)
continue;
sigdelset(&G.blocked_set, sig);
}
- sigprocmask(SIG_SETMASK, &G.blocked_set, NULL);
}
+ sigprocmask(SIG_SETMASK, &G.blocked_set, NULL);
return ret;
}