diff src/process-unix.c @ 1015:3d3204656cb4

[xemacs-hg @ 2002-09-24 14:59:22 by michaels] 2002-09-22 Mike Sperber <mike@xemacs.org> * specifier.c (specifier_add_spec): Don't do anything if NILP (inst_list)---otherwise, assertions in the rest of the specifier code get violated. 2002-09-20 Mike Sperber <mike@xemacs.org> (This partially gets back my patch from 2002-07-20 without the bug.) * process-unix.c (child_setup): Remove Ben's comment noting confusion over the file descriptors >= 3: close_process_descs() doesn't close all. Fix fd range to go up to MAXDESC-1 instead of 64. (unix_create_process): Call begin_dont_check_for_quit to inhibit unwanted interaction (and thus breaking of X event synchronicity) in the child.
author michaels
date Tue, 24 Sep 2002 14:59:25 +0000
parents 025200a2163c
children 184461bc8de4
line wrap: on
line diff
--- a/src/process-unix.c	Mon Sep 23 21:53:25 2002 +0000
+++ b/src/process-unix.c	Tue Sep 24 14:59:25 2002 +0000
@@ -1024,16 +1024,14 @@
   retry_close (out);
   retry_close (err);
 
-  /* I can't think of any reason why child processes need any more
-     than the standard 3 file descriptors.  It would be cleaner to
+  /* Close non-process-related file descriptors. It would be cleaner to
      close just the ones that need to be, but the following brute
-     force approach is certainly effective, and not too slow.
+     force approach is certainly effective, and not too slow. */
 
-     #### Who the hell added this?  We already close the descriptors
-     by using close_process_descs()!!! --ben */
   {
     int fd;
-    for (fd = 3; fd <= 64; fd++)
+
+    for (fd = 3; fd < MAXDESC; fd++)
       retry_close (fd);
   }
 
@@ -1141,6 +1139,10 @@
 	int xforkout = forkout;
 	int xforkerr = forkerr;
 
+	/* Checking for quit in the child is bad because that will 
+	   cause I/O, and that, in turn, can confuse the X connection. */
+	begin_dont_check_for_quit();
+
 	/* Disconnect the current controlling terminal, pursuant to
 	   making the pty be the controlling terminal of the process.
 	   Also put us in our own process group. */