File: fix-batch-mode-signal-handling.diff

package info (click to toggle)
emacs21 21.4a%2B1-3etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 59,104 kB
  • ctags: 58,909
  • sloc: lisp: 493,229; ansic: 237,175; xml: 4,262; sh: 4,109; makefile: 2,479; perl: 1,069; cs: 776; asm: 254; csh: 9; sed: 4
file content (38 lines) | stat: -rw-r--r-- 1,534 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
* 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