]> git.eshelyaron.com Git - emacs.git/commitdiff
Remove no-longer-needed Solaris 2.4 vfork bug workaround.
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 17 Sep 2012 01:02:11 +0000 (18:02 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 17 Sep 2012 01:02:11 +0000 (18:02 -0700)
The workaround was for improving performance on Solaris 2.4, but
is getting in the way now.  Emacs will still work if someone is
still running Solaris 2.4 in a museum somewhere; Sun dropped
support for Solaris 2.4 in 2003.
* configure.ac (ac_cv_func_vfork_works): Default to 'no' on
Solaris 2.4, so that AC_FUNC_VFORK doesn't think vfork works.
* src/callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
* src/process.c (create_process) [HAVE_WORKING_VFORK]:
Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
since Emacs no longer uses vfork on that platform.

ChangeLog
configure.ac
src/ChangeLog
src/callproc.c
src/process.c

index 5edcd767b27d7b3d9b92860d58838f86e9330345..7b9da902551237ea3938a6e7799b8e67739e8134 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-09-17  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Remove no-longer-needed Solaris 2.4 vfork bug workaround.
+       * configure.ac (ac_cv_func_vfork_works): Default to 'no' on
+       Solaris 2.4, so that AC_FUNC_VFORK doesn't think vfork works.
+
 2012-09-17  Glenn Morris  <rgm@gnu.org>
 
        * configure.ac (copyright): New output variable.
index d09d22bcbbd4d17e3aea35866efc99709e8d8906..d0cbabf3d3dae29064da642f03dd0c36f6faef31 100644 (file)
@@ -3155,6 +3155,14 @@ else
   AC_MSG_RESULT(no)
 fi
 
+dnl Check for a Solaris 2.4 vfork bug that Autoconf misses (through 2.69).
+dnl This can be removed once we assume Autoconf 2.70.
+case $canonical in
+  *-solaris2.4 | *-solaris2.4.*)
+    dnl Disable the Autoconf-generated vfork test.
+    : ${ac_cv_func_vfork_works=no};;
+esac
+
 AC_FUNC_FORK
 
 AC_CHECK_FUNCS(snprintf)
index 3c0799d14b3686c296c4d175570bfada884d9a96..daabdd7613e03e622f32538e338f360773ed32f8 100644 (file)
@@ -1,3 +1,15 @@
+2012-09-17  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Remove no-longer-needed Solaris 2.4 vfork bug workaround.
+       The workaround was for improving performance on Solaris 2.4, but
+       is getting in the way now.  Emacs will still work if someone is
+       still running Solaris 2.4 in a museum somewhere; Sun dropped
+       support for Solaris 2.4 in 2003.
+       * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
+       * process.c (create_process) [HAVE_WORKING_VFORK]:
+       Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
+       since Emacs no longer uses vfork on that platform.
+
 2012-09-17  Glenn Morris  <rgm@gnu.org>
 
        * emacs.c: Use COPYRIGHT.
index 9171337ee76c830219d941eed2e4bec0355bfff4..2604d295f3edca9b6b711fbfbb07f4e789598f7d 100644 (file)
@@ -496,11 +496,6 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS)  */)
     register char **save_environ = environ;
     register int fd1 = fd[1];
     int fd_error = fd1;
-#ifdef HAVE_WORKING_VFORK
-    sigset_t procmask;
-    sigset_t blocked;
-    struct sigaction sigpipe_action;
-#endif
 
     if (fd_output >= 0)
       fd1 = fd_output;
@@ -587,17 +582,6 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS)  */)
                       0, current_dir);
 #else  /* not WINDOWSNT */
 
-#ifdef HAVE_WORKING_VFORK
-    /* On many hosts (e.g. Solaris 2.4), if a vforked child calls `signal',
-       this sets the parent's signal handlers as well as the child's.
-       So delay all interrupts whose handlers the child might munge,
-       and record the current handlers so they can be restored later.  */
-    sigemptyset (&blocked);
-    sigaddset (&blocked, SIGPIPE);
-    sigaction (SIGPIPE, 0, &sigpipe_action);
-    pthread_sigmask (SIG_BLOCK, &blocked, &procmask);
-#endif
-
     BLOCK_INPUT;
 
     /* vfork, and prevent local vars from being clobbered by the vfork.  */
@@ -645,9 +629,6 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS)  */)
        /* GConf causes us to ignore SIGPIPE, make sure it is restored
           in the child.  */
        signal (SIGPIPE, SIG_DFL);
-#ifdef HAVE_WORKING_VFORK
-       pthread_sigmask (SIG_SETMASK, &procmask, 0);
-#endif
 
        child_setup (filefd, fd1, fd_error, (char **) new_argv,
                     0, current_dir);
@@ -655,12 +636,6 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS)  */)
 
     UNBLOCK_INPUT;
 
-#ifdef HAVE_WORKING_VFORK
-    /* Restore the signal state.  */
-    sigaction (SIGPIPE, &sigpipe_action, 0);
-    pthread_sigmask (SIG_SETMASK, &procmask, 0);
-#endif
-
 #endif /* not WINDOWSNT */
 
     /* The MSDOS case did this already.  */
index a371dece2501785532f92e3028d2bbfd585a8d72..c654369627ddcb89c21baf08502944f8b571a37a 100644 (file)
@@ -1609,14 +1609,10 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
 #if !defined (WINDOWSNT) && defined (FD_CLOEXEC)
   int wait_child_setup[2];
 #endif
+#ifdef SIGCHLD
   sigset_t blocked, procmask;
-  struct sigaction sigint_action;
-  struct sigaction sigquit_action;
-  struct sigaction sigpipe_action;
-#ifdef AIX
-  struct sigaction sighup_action;
 #endif
-  /* Use volatile to protect variables from being clobbered by longjmp.  */
+  /* Use volatile to protect variables from being clobbered by vfork.  */
   volatile int forkin, forkout;
   volatile int pty_flag = 0;
 
@@ -1708,25 +1704,13 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
   XPROCESS (process)->pty_flag = pty_flag;
   pset_status (XPROCESS (process), Qrun);
 
+#ifdef SIGCHLD
   /* Delay interrupts until we have a chance to store
      the new fork's pid in its process structure */
   sigemptyset (&blocked);
-#ifdef SIGCHLD
   sigaddset (&blocked, SIGCHLD);
-#endif
-#ifdef HAVE_WORKING_VFORK
-  /* On many hosts (e.g. Solaris 2.4), if a vforked child calls `signal',
-     this sets the parent's signal handlers as well as the child's.
-     So delay all interrupts whose handlers the child might munge,
-     and record the current handlers so they can be restored later.  */
-  sigaddset (&blocked, SIGINT );  sigaction (SIGINT , 0, &sigint_action );
-  sigaddset (&blocked, SIGQUIT);  sigaction (SIGQUIT, 0, &sigquit_action);
-  sigaddset (&blocked, SIGPIPE);  sigaction (SIGPIPE, 0, &sigpipe_action);
-#ifdef AIX
-  sigaddset (&blocked, SIGHUP );  sigaction (SIGHUP , 0, &sighup_action );
-#endif
-#endif /* HAVE_WORKING_VFORK */
   pthread_sigmask (SIG_BLOCK, &blocked, &procmask);
+#endif
 
   FD_SET (inchannel, &input_wait_mask);
   FD_SET (inchannel, &non_keyboard_wait_mask);
@@ -1879,8 +1863,10 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
           in the child.  */
        signal (SIGPIPE, SIG_DFL);
 
+#ifdef SIGCHLD
        /* Stop blocking signals in the child.  */
        pthread_sigmask (SIG_SETMASK, &procmask, 0);
+#endif
 
        if (pty_flag)
          child_setup_tty (xforkout);
@@ -1959,19 +1945,10 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
 #endif
     }
 
-  /* Restore the signal state whether vfork succeeded or not.
-     (We will signal an error, below, if it failed.)  */
-#ifdef HAVE_WORKING_VFORK
-  /* Restore the parent's signal handlers.  */
-  sigaction (SIGINT, &sigint_action, 0);
-  sigaction (SIGQUIT, &sigquit_action, 0);
-  sigaction (SIGPIPE, &sigpipe_action, 0);
-#ifdef AIX
-  sigaction (SIGHUP, &sighup_action, 0);
-#endif
-#endif /* HAVE_WORKING_VFORK */
+#ifdef SIGCHLD
   /* Stop blocking signals in the parent.  */
   pthread_sigmask (SIG_SETMASK, &procmask, 0);
+#endif
 
   /* Now generate the error if vfork failed.  */
   if (pid < 0)