rpms/bash/devel bash-sighandler.patch, 1.9, 1.10 bash.spec, 1.118, 1.119

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Wed May 31 13:30:03 UTC 2006


Author: twaugh

Update of /cvs/dist/rpms/bash/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv26190

Modified Files:
	bash-sighandler.patch bash.spec 
Log Message:
* Wed May 31 2006 Tim Waugh <twaugh at redhat.com> 3.1-14
- More sighandler fixes, this time hypothetical.


bash-sighandler.patch:
 builtins/read.def    |    1 +
 execute_cmd.c        |    1 +
 input.c              |    2 ++
 jobs.c               |    2 ++
 lib/readline/input.c |    9 +++++++++
 lib/sh/zread.c       |   11 ++++++++++-
 sig.c                |   11 +++++++++--
 sig.h                |   13 +++++++++++++
 8 files changed, 47 insertions(+), 3 deletions(-)

Index: bash-sighandler.patch
===================================================================
RCS file: /cvs/dist/rpms/bash/devel/bash-sighandler.patch,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- bash-sighandler.patch	25 May 2006 16:44:27 -0000	1.9
+++ bash-sighandler.patch	31 May 2006 13:30:00 -0000	1.10
@@ -1,5 +1,52 @@
+--- bash-3.1/input.c.sighandler	2005-07-14 13:29:08.000000000 +0100
++++ bash-3.1/input.c	2006-05-31 14:27:19.000000000 +0100
+@@ -41,6 +41,7 @@
+ #include "input.h"
+ #include "error.h"
+ #include "externs.h"
++#include "sig.h"
+ 
+ #if !defined (errno)
+ extern int errno;
+@@ -66,6 +67,7 @@
+     {
+       while (1)
+ 	{
++	  CATCH_SIGNALS ();
+ 	  local_bufused = read (fileno (stream), localbuf, sizeof(localbuf));
+ 	  if (local_bufused > 0)
+ 	    break;
+--- bash-3.1/sig.h.sighandler	2005-10-18 21:43:31.000000000 +0100
++++ bash-3.1/sig.h	2006-05-31 14:27:19.000000000 +0100
+@@ -111,8 +111,14 @@
+ /* Extern variables */
+ extern volatile int sigwinch_received;
+ 
++/* Global variables from sig.c */
++extern int need_termination_unwind_protect;
++/* and from trap.c */
++extern int running_trap;
++
+ /* Functions from sig.c. */
+ extern sighandler termination_unwind_protect __P((int));
++extern void do_termination_unwind_protect __P((int));
+ extern sighandler sigint_sighandler __P((int));
+ extern void initialize_signals __P((int));
+ extern void initialize_terminating_signals __P((void));
+@@ -129,4 +135,11 @@
+ extern SigHandler *trap_to_sighandler __P((int));
+ extern sighandler trap_handler __P((int));
+ 
++#define CATCH_SIGNALS()							\
++  do									\
++    {									\
++      if (!running_trap && need_termination_unwind_protect)		\
++	do_termination_unwind_protect (need_termination_unwind_protect); \
++    } while (0)
++	
+ #endif /* _SIG_H_ */
 --- bash-3.1/builtins/read.def.sighandler	2005-08-21 02:46:19.000000000 +0100
-+++ bash-3.1/builtins/read.def	2006-01-12 10:07:49.000000000 +0000
++++ bash-3.1/builtins/read.def	2006-05-31 14:27:19.000000000 +0100
 @@ -471,6 +471,7 @@
  #if 1
    if (retval < 0)
@@ -8,63 +55,26 @@
        builtin_error (_("read error: %d: %s"), fd, strerror (errno));
        return (EXECUTION_FAILURE);
      }
---- bash-3.1/lib/readline/input.c.sighandler	2005-07-05 03:30:24.000000000 +0100
-+++ bash-3.1/lib/readline/input.c	2006-01-12 10:17:30.000000000 +0000
-@@ -435,6 +435,10 @@
-   return (c);
- }
- 
-+/* From bash */
-+extern int need_termination_unwind_protect;
-+extern void do_termination_unwind_protect (int);
-+
- int
- rl_getc (stream)
-      FILE *stream;
-@@ -450,6 +454,9 @@
- #endif
-       result = read (fileno (stream), &c, sizeof (unsigned char));
- 
-+      if (need_termination_unwind_protect)
-+        do_termination_unwind_protect (need_termination_unwind_protect);
-+
-       if (result == sizeof (unsigned char))
- 	return (c);
- 
---- bash-3.1/lib/sh/zread.c.sighandler	2005-03-10 03:17:05.000000000 +0000
-+++ bash-3.1/lib/sh/zread.c	2006-01-12 10:07:49.000000000 +0000
-@@ -34,6 +34,10 @@
- #  define SEEK_CUR 1
- #endif
+--- bash-3.1/jobs.c.sighandler	2006-05-31 14:27:18.000000000 +0100
++++ bash-3.1/jobs.c	2006-05-31 14:27:19.000000000 +0100
+@@ -2907,6 +2907,7 @@
+ 			: 0;
+       if (sigchld || block == 0)
+ 	waitpid_flags |= WNOHANG;
++      CATCH_SIGNALS ();
+       pid = WAITPID (-1, &status, waitpid_flags);
  
-+/* From bash */
-+extern int need_termination_unwind_protect;
-+extern void do_termination_unwind_protect (int);
-+
- /* Read LEN bytes from FD into BUF.  Retry the read on EINTR.  Any other
-    error causes the loop to break. */
- ssize_t
-@@ -45,7 +49,8 @@
-   ssize_t r;
+       /* WCONTINUED may be rejected by waitpid as invalid even when defined */
+@@ -2933,6 +2934,7 @@
  
-   while ((r = read (fd, buf, len)) < 0 && errno == EINTR)
--    ;
-+    if (need_termination_unwind_protect)
-+      do_termination_unwind_protect (need_termination_unwind_protect);
-   return r;
- }
+       /* If waitpid returns 0, there are running children.  If it returns -1,
+ 	 the only other error POSIX says it can return is EINTR. */
++      CATCH_SIGNALS ();
+       if (pid <= 0)
+ 	continue;	/* jumps right to the test */
  
-@@ -73,6 +78,8 @@
- 	return r;
-       if (r == -1 && errno == EINTR)
- 	{
-+	  if (need_termination_unwind_protect)
-+	    do_termination_unwind_protect (need_termination_unwind_protect);
- 	  if (++nintr > NUM_INTR)
- 	    return -1;
- 	  continue;
 --- bash-3.1/sig.c.sighandler	2005-10-22 22:04:03.000000000 +0100
-+++ bash-3.1/sig.c	2006-01-12 10:07:49.000000000 +0000
++++ bash-3.1/sig.c	2006-05-31 14:27:19.000000000 +0100
 @@ -58,6 +58,8 @@
  extern int loop_level, continuing, breaking;
  extern int parse_and_execute_level, shell_initialized;
@@ -97,78 +107,72 @@
  }
  
  /* What we really do when SIGINT occurs. */
---- bash-3.1/sig.h.sighandler	2005-10-18 21:43:31.000000000 +0100
-+++ bash-3.1/sig.h	2006-05-25 17:37:59.000000000 +0100
-@@ -111,8 +111,14 @@
- /* Extern variables */
- extern volatile int sigwinch_received;
+--- bash-3.1/execute_cmd.c.sighandler	2006-05-31 14:27:19.000000000 +0100
++++ bash-3.1/execute_cmd.c	2006-05-31 14:27:19.000000000 +0100
+@@ -363,6 +363,7 @@
+     unlink_fifo_list ();
+ #endif /* PROCESS_SUBSTITUTION */
  
-+/* Global variables from sig.c */
++  CATCH_SIGNALS ();
+   return (result);
+ }
+ 
+--- bash-3.1/lib/readline/input.c.sighandler	2005-07-05 03:30:24.000000000 +0100
++++ bash-3.1/lib/readline/input.c	2006-05-31 14:28:27.000000000 +0100
+@@ -435,6 +435,12 @@
+   return (c);
+ }
+ 
++/* From bash */
 +extern int need_termination_unwind_protect;
++extern void do_termination_unwind_protect (int);
 +/* and from trap.c */
 +extern int running_trap;
 +
- /* Functions from sig.c. */
- extern sighandler termination_unwind_protect __P((int));
-+extern void do_termination_unwind_protect __P((int));
- extern sighandler sigint_sighandler __P((int));
- extern void initialize_signals __P((int));
- extern void initialize_terminating_signals __P((void));
-@@ -129,4 +135,11 @@
- extern SigHandler *trap_to_sighandler __P((int));
- extern sighandler trap_handler __P((int));
- 
-+#define CATCH_SIGNALS()							\
-+  do									\
-+    {									\
-+      if (!running_trap && need_termination_unwind_protect)		\
-+	do_termination_unwind_protect (need_termination_unwind_protect); \
-+    } while (0)
-+	
- #endif /* _SIG_H_ */
---- bash-3.1/input.c.sighandler	2005-07-14 13:29:08.000000000 +0100
-+++ bash-3.1/input.c	2006-01-12 10:07:49.000000000 +0000
-@@ -41,6 +41,7 @@
- #include "input.h"
- #include "error.h"
- #include "externs.h"
-+#include "sig.h"
- 
- #if !defined (errno)
- extern int errno;
-@@ -66,6 +67,7 @@
-     {
-       while (1)
- 	{
-+	  CATCH_SIGNALS ();
- 	  local_bufused = read (fileno (stream), localbuf, sizeof(localbuf));
- 	  if (local_bufused > 0)
- 	    break;
---- bash-3.1/jobs.c.sighandler	2005-11-12 04:13:27.000000000 +0000
-+++ bash-3.1/jobs.c	2006-01-12 10:07:49.000000000 +0000
-@@ -2865,6 +2865,7 @@
- 			: 0;
-       if (sigchld || block == 0)
- 	waitpid_flags |= WNOHANG;
-+      CATCH_SIGNALS ();
-       pid = WAITPID (-1, &status, waitpid_flags);
+ int
+ rl_getc (stream)
+      FILE *stream;
+@@ -450,6 +456,9 @@
+ #endif
+       result = read (fileno (stream), &c, sizeof (unsigned char));
  
-       /* WCONTINUED may be rejected by waitpid as invalid even when defined */
-@@ -2891,6 +2892,7 @@
++      if (!running_trap && need_termination_unwind_protect)
++        do_termination_unwind_protect (need_termination_unwind_protect);
++
+       if (result == sizeof (unsigned char))
+ 	return (c);
  
-       /* If waitpid returns 0, there are running children.  If it returns -1,
- 	 the only other error POSIX says it can return is EINTR. */
-+      CATCH_SIGNALS ();
-       if (pid <= 0)
- 	continue;	/* jumps right to the test */
+--- bash-3.1/lib/sh/zread.c.sighandler	2005-03-10 03:17:05.000000000 +0000
++++ bash-3.1/lib/sh/zread.c	2006-05-31 14:29:00.000000000 +0100
+@@ -34,6 +34,12 @@
+ #  define SEEK_CUR 1
+ #endif
  
---- bash-3.1/execute_cmd.c.sighandler	2006-01-12 10:07:48.000000000 +0000
-+++ bash-3.1/execute_cmd.c	2006-01-12 10:07:49.000000000 +0000
-@@ -363,6 +363,7 @@
-     unlink_fifo_list ();
- #endif /* PROCESS_SUBSTITUTION */
++/* From bash */
++extern int need_termination_unwind_protect;
++extern void do_termination_unwind_protect (int);
++/* and from trap.c */
++extern int running_trap;
++
+ /* Read LEN bytes from FD into BUF.  Retry the read on EINTR.  Any other
+    error causes the loop to break. */
+ ssize_t
+@@ -45,7 +51,8 @@
+   ssize_t r;
  
-+  CATCH_SIGNALS ();
-   return (result);
+   while ((r = read (fd, buf, len)) < 0 && errno == EINTR)
+-    ;
++    if (!running_trap && need_termination_unwind_protect)
++      do_termination_unwind_protect (need_termination_unwind_protect);
+   return r;
  }
  
+@@ -73,6 +80,8 @@
+ 	return r;
+       if (r == -1 && errno == EINTR)
+ 	{
++	  if (!running_trap && need_termination_unwind_protect)
++	    do_termination_unwind_protect (need_termination_unwind_protect);
+ 	  if (++nintr > NUM_INTR)
+ 	    return -1;
+ 	  continue;


Index: bash.spec
===================================================================
RCS file: /cvs/dist/rpms/bash/devel/bash.spec,v
retrieving revision 1.118
retrieving revision 1.119
diff -u -r1.118 -r1.119
--- bash.spec	25 May 2006 16:44:27 -0000	1.118
+++ bash.spec	31 May 2006 13:30:00 -0000	1.119
@@ -1,7 +1,7 @@
 Version: 3.1
 Name: bash
 Summary: The GNU Bourne Again shell (bash) version %{version}.
-Release: 13
+Release: 14
 Group: System Environment/Shells
 License: GPL
 Url: http://www.gnu.org/software/bash
@@ -234,6 +234,9 @@
 %doc doc/*.ps doc/*.0 doc/*.html doc/article.txt
 
 %changelog
+* Wed May 31 2006 Tim Waugh <twaugh at redhat.com> 3.1-14
+- More sighandler fixes, this time hypothetical.
+
 * Thu May 26 2006 Tim Waugh <twaugh at redhat.com> 3.1-13
 - Another fix for the sighandler patch (bug #192297).
 




More information about the fedora-cvs-commits mailing list