aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
authorAndreas Schwab2011-02-12 19:53:24 +0100
committerAndreas Schwab2011-02-12 19:53:24 +0100
commitc0ad4ea54c2df6ab594c10ec581e30543b8b0df1 (patch)
tree689102bee9424c03fb1c7b01fed4cd21134be7c9 /src/process.c
parente2784c87183787f8d5bffb0cf10e08fabe02ff91 (diff)
downloademacs-c0ad4ea54c2df6ab594c10ec581e30543b8b0df1.tar.gz
emacs-c0ad4ea54c2df6ab594c10ec581e30543b8b0df1.zip
Make sure SIGPIPE is reset in child processes
* process.c (create_process): Reset SIGPIPE handler in the child. * callproc.c (Fcall_process): Likewise. (Bug#5238)
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/process.c b/src/process.c
index 80e70e49f8e..d026b9d030b 100644
--- a/src/process.c
+++ b/src/process.c
@@ -1786,6 +1786,7 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
1786 sigset_t blocked; 1786 sigset_t blocked;
1787 struct sigaction sigint_action; 1787 struct sigaction sigint_action;
1788 struct sigaction sigquit_action; 1788 struct sigaction sigquit_action;
1789 struct sigaction sigpipe_action;
1789#ifdef AIX 1790#ifdef AIX
1790 struct sigaction sighup_action; 1791 struct sigaction sighup_action;
1791#endif 1792#endif
@@ -1898,6 +1899,7 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
1898 and record the current handlers so they can be restored later. */ 1899 and record the current handlers so they can be restored later. */
1899 sigaddset (&blocked, SIGINT ); sigaction (SIGINT , 0, &sigint_action ); 1900 sigaddset (&blocked, SIGINT ); sigaction (SIGINT , 0, &sigint_action );
1900 sigaddset (&blocked, SIGQUIT); sigaction (SIGQUIT, 0, &sigquit_action); 1901 sigaddset (&blocked, SIGQUIT); sigaction (SIGQUIT, 0, &sigquit_action);
1902 sigaddset (&blocked, SIGPIPE); sigaction (SIGPIPE, 0, &sigpipe_action);
1901#ifdef AIX 1903#ifdef AIX
1902 sigaddset (&blocked, SIGHUP ); sigaction (SIGHUP , 0, &sighup_action ); 1904 sigaddset (&blocked, SIGHUP ); sigaction (SIGHUP , 0, &sighup_action );
1903#endif 1905#endif
@@ -2054,6 +2056,9 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
2054 2056
2055 signal (SIGINT, SIG_DFL); 2057 signal (SIGINT, SIG_DFL);
2056 signal (SIGQUIT, SIG_DFL); 2058 signal (SIGQUIT, SIG_DFL);
2059 /* GTK causes us to ignore SIGPIPE, make sure it is restored
2060 in the child. */
2061 signal (SIGPIPE, SIG_DFL);
2057 2062
2058 /* Stop blocking signals in the child. */ 2063 /* Stop blocking signals in the child. */
2059 sigprocmask (SIG_SETMASK, &procmask, 0); 2064 sigprocmask (SIG_SETMASK, &procmask, 0);
@@ -2142,6 +2147,7 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
2142 /* Restore the parent's signal handlers. */ 2147 /* Restore the parent's signal handlers. */
2143 sigaction (SIGINT, &sigint_action, 0); 2148 sigaction (SIGINT, &sigint_action, 0);
2144 sigaction (SIGQUIT, &sigquit_action, 0); 2149 sigaction (SIGQUIT, &sigquit_action, 0);
2150 sigaction (SIGPIPE, &sigpipe_action, 0);
2145#ifdef AIX 2151#ifdef AIX
2146 sigaction (SIGHUP, &sighup_action, 0); 2152 sigaction (SIGHUP, &sighup_action, 0);
2147#endif 2153#endif