changeset 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 deaf6c4f5a1c
children e51c114a076a
files src/ChangeLog src/process-unix.c src/specifier.c
diffstat 3 files changed, 29 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Mon Sep 23 21:53:25 2002 +0000
+++ b/src/ChangeLog	Tue Sep 24 14:59:25 2002 +0000
@@ -1,3 +1,21 @@
+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.
+
 2002-08-08  Jerry James  <james@xemacs.org>
 
 	* Makefile.in.in: ldap.o and postgresql.o have moved.
--- 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. */
--- a/src/specifier.c	Mon Sep 23 21:53:25 2002 +0000
+++ b/src/specifier.c	Tue Sep 24 14:59:25 2002 +0000
@@ -1750,6 +1750,9 @@
   Lisp_Object list_to_build_up = Qnil;
   struct gcpro gcpro1;
 
+  if (NILP (inst_list))
+    return;
+
   GCPRO1 (list_to_build_up);
   list_to_build_up = build_up_processed_list (specifier, locale, inst_list);
   /* Now handle REMOVE_LOCALE_TYPE and REMOVE_ALL.  These are the