summaryrefslogtreecommitdiff
path: root/builtins/trap.def
diff options
context:
space:
mode:
Diffstat (limited to 'builtins/trap.def')
-rw-r--r--builtins/trap.def11
1 files changed, 7 insertions, 4 deletions
diff --git a/builtins/trap.def b/builtins/trap.def
index 669bea7..2735791 100644
--- a/builtins/trap.def
+++ b/builtins/trap.def
@@ -1,7 +1,7 @@
This file is trap.def, from which is created trap.c.
It implements the builtin "trap" in Bash.
-Copyright (C) 1987-2005 Free Software Foundation, Inc.
+Copyright (C) 1987-2006 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -87,7 +87,7 @@ int
trap_builtin (list)
WORD_LIST *list;
{
- int list_signal_names, display, result, opt, first_signal;
+ int list_signal_names, display, result, opt;
list_signal_names = display = 0;
result = EXECUTION_SUCCESS;
@@ -124,7 +124,10 @@ trap_builtin (list)
first_arg = list->word->word;
first_signal = first_arg && *first_arg && all_digits (first_arg) && signal_object_p (first_arg, opt);
- /* Backwards compatibility */
+ /* Backwards compatibility. XXX - question about whether or not we
+ should throw an error if an all-digit argument doesn't correspond
+ to a valid signal number (e.g., if it's `50' on a system with only
+ 32 signals). */
if (first_signal)
operation = REVERT;
/* When in posix mode, the historical behavior of looking for a
@@ -176,7 +179,7 @@ trap_builtin (list)
if (interactive)
set_signal_handler (SIGINT, sigint_sighandler);
else
- set_signal_handler (SIGINT, termination_unwind_protect);
+ set_signal_handler (SIGINT, termsig_sighandler);
break;
case SIGQUIT: