From 2d698b6e42d8dca191ac795ef5dba3bf62496eec Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen.hemminger@vyatta.com>
Date: Fri, 9 Apr 2010 16:13:32 -0700
Subject: Integrate bash 3.2 version

This is merge of current Debian stable (Lenny) version of Bash
with Vyatta changes.
---
 builtins/trap.def | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

(limited to 'builtins/trap.def')

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:
-- 
cgit v1.2.3

