diff options
| author | Paul Eggert | 2012-09-16 18:02:11 -0700 |
|---|---|---|
| committer | Paul Eggert | 2012-09-16 18:02:11 -0700 |
| commit | eeceac9312792b15bbafea16dec45a6b7d1312cc (patch) | |
| tree | b1f3baf864d0785bdc6ec8ea8ad24d8544d1de32 | |
| parent | 78f83752f50a2aa9944e60a5aceac4015eb3ca58 (diff) | |
| download | emacs-eeceac9312792b15bbafea16dec45a6b7d1312cc.tar.gz emacs-eeceac9312792b15bbafea16dec45a6b7d1312cc.zip | |
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.
* 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.
| -rw-r--r-- | ChangeLog | 6 | ||||
| -rw-r--r-- | configure.ac | 8 | ||||
| -rw-r--r-- | src/ChangeLog | 12 | ||||
| -rw-r--r-- | src/callproc.c | 25 | ||||
| -rw-r--r-- | src/process.c | 39 |
5 files changed, 34 insertions, 56 deletions
| @@ -1,3 +1,9 @@ | |||
| 1 | 2012-09-17 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Remove no-longer-needed Solaris 2.4 vfork bug workaround. | ||
| 4 | * configure.ac (ac_cv_func_vfork_works): Default to 'no' on | ||
| 5 | Solaris 2.4, so that AC_FUNC_VFORK doesn't think vfork works. | ||
| 6 | |||
| 1 | 2012-09-17 Glenn Morris <rgm@gnu.org> | 7 | 2012-09-17 Glenn Morris <rgm@gnu.org> |
| 2 | 8 | ||
| 3 | * configure.ac (copyright): New output variable. | 9 | * configure.ac (copyright): New output variable. |
diff --git a/configure.ac b/configure.ac index d09d22bcbbd..d0cbabf3d3d 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -3155,6 +3155,14 @@ else | |||
| 3155 | AC_MSG_RESULT(no) | 3155 | AC_MSG_RESULT(no) |
| 3156 | fi | 3156 | fi |
| 3157 | 3157 | ||
| 3158 | dnl Check for a Solaris 2.4 vfork bug that Autoconf misses (through 2.69). | ||
| 3159 | dnl This can be removed once we assume Autoconf 2.70. | ||
| 3160 | case $canonical in | ||
| 3161 | *-solaris2.4 | *-solaris2.4.*) | ||
| 3162 | dnl Disable the Autoconf-generated vfork test. | ||
| 3163 | : ${ac_cv_func_vfork_works=no};; | ||
| 3164 | esac | ||
| 3165 | |||
| 3158 | AC_FUNC_FORK | 3166 | AC_FUNC_FORK |
| 3159 | 3167 | ||
| 3160 | AC_CHECK_FUNCS(snprintf) | 3168 | AC_CHECK_FUNCS(snprintf) |
diff --git a/src/ChangeLog b/src/ChangeLog index 3c0799d14b3..daabdd7613e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,15 @@ | |||
| 1 | 2012-09-17 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Remove no-longer-needed Solaris 2.4 vfork bug workaround. | ||
| 4 | The workaround was for improving performance on Solaris 2.4, but | ||
| 5 | is getting in the way now. Emacs will still work if someone is | ||
| 6 | still running Solaris 2.4 in a museum somewhere; Sun dropped | ||
| 7 | support for Solaris 2.4 in 2003. | ||
| 8 | * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]: | ||
| 9 | * process.c (create_process) [HAVE_WORKING_VFORK]: | ||
| 10 | Omit now-unnecessary workaround for the Solaris 2.4 vfork bug, | ||
| 11 | since Emacs no longer uses vfork on that platform. | ||
| 12 | |||
| 1 | 2012-09-17 Glenn Morris <rgm@gnu.org> | 13 | 2012-09-17 Glenn Morris <rgm@gnu.org> |
| 2 | 14 | ||
| 3 | * emacs.c: Use COPYRIGHT. | 15 | * emacs.c: Use COPYRIGHT. |
diff --git a/src/callproc.c b/src/callproc.c index 9171337ee76..2604d295f3e 100644 --- a/src/callproc.c +++ b/src/callproc.c | |||
| @@ -496,11 +496,6 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 496 | register char **save_environ = environ; | 496 | register char **save_environ = environ; |
| 497 | register int fd1 = fd[1]; | 497 | register int fd1 = fd[1]; |
| 498 | int fd_error = fd1; | 498 | int fd_error = fd1; |
| 499 | #ifdef HAVE_WORKING_VFORK | ||
| 500 | sigset_t procmask; | ||
| 501 | sigset_t blocked; | ||
| 502 | struct sigaction sigpipe_action; | ||
| 503 | #endif | ||
| 504 | 499 | ||
| 505 | if (fd_output >= 0) | 500 | if (fd_output >= 0) |
| 506 | fd1 = fd_output; | 501 | fd1 = fd_output; |
| @@ -587,17 +582,6 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 587 | 0, current_dir); | 582 | 0, current_dir); |
| 588 | #else /* not WINDOWSNT */ | 583 | #else /* not WINDOWSNT */ |
| 589 | 584 | ||
| 590 | #ifdef HAVE_WORKING_VFORK | ||
| 591 | /* On many hosts (e.g. Solaris 2.4), if a vforked child calls `signal', | ||
| 592 | this sets the parent's signal handlers as well as the child's. | ||
| 593 | So delay all interrupts whose handlers the child might munge, | ||
| 594 | and record the current handlers so they can be restored later. */ | ||
| 595 | sigemptyset (&blocked); | ||
| 596 | sigaddset (&blocked, SIGPIPE); | ||
| 597 | sigaction (SIGPIPE, 0, &sigpipe_action); | ||
| 598 | pthread_sigmask (SIG_BLOCK, &blocked, &procmask); | ||
| 599 | #endif | ||
| 600 | |||
| 601 | BLOCK_INPUT; | 585 | BLOCK_INPUT; |
| 602 | 586 | ||
| 603 | /* vfork, and prevent local vars from being clobbered by the vfork. */ | 587 | /* 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) */) | |||
| 645 | /* GConf causes us to ignore SIGPIPE, make sure it is restored | 629 | /* GConf causes us to ignore SIGPIPE, make sure it is restored |
| 646 | in the child. */ | 630 | in the child. */ |
| 647 | signal (SIGPIPE, SIG_DFL); | 631 | signal (SIGPIPE, SIG_DFL); |
| 648 | #ifdef HAVE_WORKING_VFORK | ||
| 649 | pthread_sigmask (SIG_SETMASK, &procmask, 0); | ||
| 650 | #endif | ||
| 651 | 632 | ||
| 652 | child_setup (filefd, fd1, fd_error, (char **) new_argv, | 633 | child_setup (filefd, fd1, fd_error, (char **) new_argv, |
| 653 | 0, current_dir); | 634 | 0, current_dir); |
| @@ -655,12 +636,6 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 655 | 636 | ||
| 656 | UNBLOCK_INPUT; | 637 | UNBLOCK_INPUT; |
| 657 | 638 | ||
| 658 | #ifdef HAVE_WORKING_VFORK | ||
| 659 | /* Restore the signal state. */ | ||
| 660 | sigaction (SIGPIPE, &sigpipe_action, 0); | ||
| 661 | pthread_sigmask (SIG_SETMASK, &procmask, 0); | ||
| 662 | #endif | ||
| 663 | |||
| 664 | #endif /* not WINDOWSNT */ | 639 | #endif /* not WINDOWSNT */ |
| 665 | 640 | ||
| 666 | /* The MSDOS case did this already. */ | 641 | /* The MSDOS case did this already. */ |
diff --git a/src/process.c b/src/process.c index a371dece250..c654369627d 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -1609,14 +1609,10 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir) | |||
| 1609 | #if !defined (WINDOWSNT) && defined (FD_CLOEXEC) | 1609 | #if !defined (WINDOWSNT) && defined (FD_CLOEXEC) |
| 1610 | int wait_child_setup[2]; | 1610 | int wait_child_setup[2]; |
| 1611 | #endif | 1611 | #endif |
| 1612 | #ifdef SIGCHLD | ||
| 1612 | sigset_t blocked, procmask; | 1613 | sigset_t blocked, procmask; |
| 1613 | struct sigaction sigint_action; | ||
| 1614 | struct sigaction sigquit_action; | ||
| 1615 | struct sigaction sigpipe_action; | ||
| 1616 | #ifdef AIX | ||
| 1617 | struct sigaction sighup_action; | ||
| 1618 | #endif | 1614 | #endif |
| 1619 | /* Use volatile to protect variables from being clobbered by longjmp. */ | 1615 | /* Use volatile to protect variables from being clobbered by vfork. */ |
| 1620 | volatile int forkin, forkout; | 1616 | volatile int forkin, forkout; |
| 1621 | volatile int pty_flag = 0; | 1617 | volatile int pty_flag = 0; |
| 1622 | 1618 | ||
| @@ -1708,25 +1704,13 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir) | |||
| 1708 | XPROCESS (process)->pty_flag = pty_flag; | 1704 | XPROCESS (process)->pty_flag = pty_flag; |
| 1709 | pset_status (XPROCESS (process), Qrun); | 1705 | pset_status (XPROCESS (process), Qrun); |
| 1710 | 1706 | ||
| 1707 | #ifdef SIGCHLD | ||
| 1711 | /* Delay interrupts until we have a chance to store | 1708 | /* Delay interrupts until we have a chance to store |
| 1712 | the new fork's pid in its process structure */ | 1709 | the new fork's pid in its process structure */ |
| 1713 | sigemptyset (&blocked); | 1710 | sigemptyset (&blocked); |
| 1714 | #ifdef SIGCHLD | ||
| 1715 | sigaddset (&blocked, SIGCHLD); | 1711 | sigaddset (&blocked, SIGCHLD); |
| 1716 | #endif | ||
| 1717 | #ifdef HAVE_WORKING_VFORK | ||
| 1718 | /* On many hosts (e.g. Solaris 2.4), if a vforked child calls `signal', | ||
| 1719 | this sets the parent's signal handlers as well as the child's. | ||
| 1720 | So delay all interrupts whose handlers the child might munge, | ||
| 1721 | and record the current handlers so they can be restored later. */ | ||
| 1722 | sigaddset (&blocked, SIGINT ); sigaction (SIGINT , 0, &sigint_action ); | ||
| 1723 | sigaddset (&blocked, SIGQUIT); sigaction (SIGQUIT, 0, &sigquit_action); | ||
| 1724 | sigaddset (&blocked, SIGPIPE); sigaction (SIGPIPE, 0, &sigpipe_action); | ||
| 1725 | #ifdef AIX | ||
| 1726 | sigaddset (&blocked, SIGHUP ); sigaction (SIGHUP , 0, &sighup_action ); | ||
| 1727 | #endif | ||
| 1728 | #endif /* HAVE_WORKING_VFORK */ | ||
| 1729 | pthread_sigmask (SIG_BLOCK, &blocked, &procmask); | 1712 | pthread_sigmask (SIG_BLOCK, &blocked, &procmask); |
| 1713 | #endif | ||
| 1730 | 1714 | ||
| 1731 | FD_SET (inchannel, &input_wait_mask); | 1715 | FD_SET (inchannel, &input_wait_mask); |
| 1732 | FD_SET (inchannel, &non_keyboard_wait_mask); | 1716 | FD_SET (inchannel, &non_keyboard_wait_mask); |
| @@ -1879,8 +1863,10 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir) | |||
| 1879 | in the child. */ | 1863 | in the child. */ |
| 1880 | signal (SIGPIPE, SIG_DFL); | 1864 | signal (SIGPIPE, SIG_DFL); |
| 1881 | 1865 | ||
| 1866 | #ifdef SIGCHLD | ||
| 1882 | /* Stop blocking signals in the child. */ | 1867 | /* Stop blocking signals in the child. */ |
| 1883 | pthread_sigmask (SIG_SETMASK, &procmask, 0); | 1868 | pthread_sigmask (SIG_SETMASK, &procmask, 0); |
| 1869 | #endif | ||
| 1884 | 1870 | ||
| 1885 | if (pty_flag) | 1871 | if (pty_flag) |
| 1886 | child_setup_tty (xforkout); | 1872 | child_setup_tty (xforkout); |
| @@ -1959,19 +1945,10 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir) | |||
| 1959 | #endif | 1945 | #endif |
| 1960 | } | 1946 | } |
| 1961 | 1947 | ||
| 1962 | /* Restore the signal state whether vfork succeeded or not. | 1948 | #ifdef SIGCHLD |
| 1963 | (We will signal an error, below, if it failed.) */ | ||
| 1964 | #ifdef HAVE_WORKING_VFORK | ||
| 1965 | /* Restore the parent's signal handlers. */ | ||
| 1966 | sigaction (SIGINT, &sigint_action, 0); | ||
| 1967 | sigaction (SIGQUIT, &sigquit_action, 0); | ||
| 1968 | sigaction (SIGPIPE, &sigpipe_action, 0); | ||
| 1969 | #ifdef AIX | ||
| 1970 | sigaction (SIGHUP, &sighup_action, 0); | ||
| 1971 | #endif | ||
| 1972 | #endif /* HAVE_WORKING_VFORK */ | ||
| 1973 | /* Stop blocking signals in the parent. */ | 1949 | /* Stop blocking signals in the parent. */ |
| 1974 | pthread_sigmask (SIG_SETMASK, &procmask, 0); | 1950 | pthread_sigmask (SIG_SETMASK, &procmask, 0); |
| 1951 | #endif | ||
| 1975 | 1952 | ||
| 1976 | /* Now generate the error if vfork failed. */ | 1953 | /* Now generate the error if vfork failed. */ |
| 1977 | if (pid < 0) | 1954 | if (pid < 0) |