* A problem with non-interactive signal handling has been fixed.
  Patch: fix-batch-mode-signal-handling.diff
  Added-by: Rob Browning <rlb@defaultvalue.org>
  Status: patch backported from upstream
  
  An upstream patch from 2003-06-21 was backported to fix Bug#253887.
  Under certain conditions running "emacs --batch ... < /dev/null"
  would trigger a process exit via SIGIO or SIGHUP.

diff -urNad /home/rlb/deb/emacs/trunk-21/src/keyboard.c trunk-21/src/keyboard.c
--- /home/rlb/deb/emacs/trunk-21/src/keyboard.c	2003-09-09 17:26:14.000000000 -0500
+++ trunk-21/src/keyboard.c	2004-07-18 17:10:35.000000000 -0500
@@ -6186,7 +6186,12 @@
 	/* ??? Is it really right to send the signal just to this process
 	   rather than to the whole process group?
 	   Perhaps on systems with FIONREAD Emacs is alone in its group.  */
-	kill (getpid (), SIGHUP);
+        {
+          if (! noninteractive)
+            kill (getpid (), SIGHUP);
+          else
+            n_to_read = 0;
+        }
       if (n_to_read == 0)
 	return 0;
       if (n_to_read > sizeof cbuf)
diff -urNad /home/rlb/deb/emacs/trunk-21/src/process.c trunk-21/src/process.c
--- /home/rlb/deb/emacs/trunk-21/src/process.c	2003-09-09 17:28:35.000000000 -0500
+++ trunk-21/src/process.c	2004-07-18 17:11:21.000000000 -0500
@@ -2734,7 +2734,7 @@
 	 but select says there is input.  */
 
       if (XINT (read_kbd) && interrupt_input
-	  && keyboard_bit_set (&Available))
+	  && keyboard_bit_set (&Available) && ! noninteractive)
 	kill (getpid (), SIGIO);
 #endif
 
