summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ChangeLog4
-rw-r--r--src/trap.c6
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index d57ebc1..bc36ab1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-04-02  Herbert Xu <herbert@gondor.apana.org.au>
+
+	* Make trap signal name/number errors non-fatal.
+
 2010-04-02  maximilian attems <max@stro.at>
 
 	* Use TMPDIR in mkbuiltins.
diff --git a/src/trap.c b/src/trap.c
index 16703b3..3f93c46 100644
--- a/src/trap.c
+++ b/src/trap.c
@@ -117,8 +117,10 @@ trapcmd(int argc, char **argv)
 	else
 		action = *ap++;
 	while (*ap) {
-		if ((signo = decode_signal(*ap, 0)) < 0)
-			sh_error("%s: bad trap", *ap);
+		if ((signo = decode_signal(*ap, 0)) < 0) {
+			outfmt(out2, "trap: %s: bad trap\n", *ap);
+			return 1;
+		}
 		INTOFF;
 		if (action) {
 			if (action[0] == '-' && action[1] == '\0')