mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-30 08:09:04 +00:00
Use pthread_sigmask, not sigprocmask.
* callproc.c (Fcall_process): * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask): * process.c (create_process): sigprocmask is portable only for single-threaded applications, and Emacs can be multi-threaded when it uses GTK.
This commit is contained in:
parent
6db30f8344
commit
123403e42f
@ -1,3 +1,12 @@
|
||||
2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
Use pthread_sigmask, not sigprocmask.
|
||||
* callproc.c (Fcall_process):
|
||||
* sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
|
||||
* process.c (create_process):
|
||||
sigprocmask is portable only for single-threaded applications, and
|
||||
Emacs can be multi-threaded when it uses GTK.
|
||||
|
||||
2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
|
||||
|
||||
* xsettings.c: Use both GConf and GSettings if both are available.
|
||||
|
@ -596,7 +596,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
|
||||
sigemptyset (&blocked);
|
||||
sigaddset (&blocked, SIGPIPE);
|
||||
sigaction (SIGPIPE, 0, &sigpipe_action);
|
||||
sigprocmask (SIG_BLOCK, &blocked, &procmask);
|
||||
pthread_sigmask (SIG_BLOCK, &blocked, &procmask);
|
||||
#endif
|
||||
|
||||
BLOCK_INPUT;
|
||||
@ -633,7 +633,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
|
||||
in the child. */
|
||||
//signal (SIGPIPE, SIG_DFL);
|
||||
#ifdef HAVE_WORKING_VFORK
|
||||
sigprocmask (SIG_SETMASK, &procmask, 0);
|
||||
pthread_sigmask (SIG_SETMASK, &procmask, 0);
|
||||
#endif
|
||||
|
||||
child_setup (filefd, fd1, fd_error, (char **) new_argv,
|
||||
@ -645,7 +645,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
|
||||
#ifdef HAVE_WORKING_VFORK
|
||||
/* Restore the signal state. */
|
||||
sigaction (SIGPIPE, &sigpipe_action, 0);
|
||||
sigprocmask (SIG_SETMASK, &procmask, 0);
|
||||
pthread_sigmask (SIG_SETMASK, &procmask, 0);
|
||||
#endif
|
||||
|
||||
#endif /* not WINDOWSNT */
|
||||
|
@ -1652,7 +1652,7 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
|
||||
sigaddset (&blocked, SIGHUP ); sigaction (SIGHUP , 0, &sighup_action );
|
||||
#endif
|
||||
#endif /* HAVE_WORKING_VFORK */
|
||||
sigprocmask (SIG_BLOCK, &blocked, &procmask);
|
||||
pthread_sigmask (SIG_BLOCK, &blocked, &procmask);
|
||||
|
||||
FD_SET (inchannel, &input_wait_mask);
|
||||
FD_SET (inchannel, &non_keyboard_wait_mask);
|
||||
@ -1808,7 +1808,7 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
|
||||
signal (SIGPIPE, SIG_DFL);
|
||||
|
||||
/* Stop blocking signals in the child. */
|
||||
sigprocmask (SIG_SETMASK, &procmask, 0);
|
||||
pthread_sigmask (SIG_SETMASK, &procmask, 0);
|
||||
|
||||
if (pty_flag)
|
||||
child_setup_tty (xforkout);
|
||||
@ -1900,7 +1900,7 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
|
||||
#endif
|
||||
#endif /* HAVE_WORKING_VFORK */
|
||||
/* Stop blocking signals in the parent. */
|
||||
sigprocmask (SIG_SETMASK, &procmask, 0);
|
||||
pthread_sigmask (SIG_SETMASK, &procmask, 0);
|
||||
|
||||
/* Now generate the error if vfork failed. */
|
||||
if (pid < 0)
|
||||
|
@ -1534,7 +1534,7 @@ sigset_t
|
||||
sys_sigblock (sigset_t new_mask)
|
||||
{
|
||||
sigset_t old_mask;
|
||||
sigprocmask (SIG_BLOCK, &new_mask, &old_mask);
|
||||
pthread_sigmask (SIG_BLOCK, &new_mask, &old_mask);
|
||||
return (old_mask);
|
||||
}
|
||||
|
||||
@ -1542,7 +1542,7 @@ sigset_t
|
||||
sys_sigunblock (sigset_t new_mask)
|
||||
{
|
||||
sigset_t old_mask;
|
||||
sigprocmask (SIG_UNBLOCK, &new_mask, &old_mask);
|
||||
pthread_sigmask (SIG_UNBLOCK, &new_mask, &old_mask);
|
||||
return (old_mask);
|
||||
}
|
||||
|
||||
@ -1550,7 +1550,7 @@ sigset_t
|
||||
sys_sigsetmask (sigset_t new_mask)
|
||||
{
|
||||
sigset_t old_mask;
|
||||
sigprocmask (SIG_SETMASK, &new_mask, &old_mask);
|
||||
pthread_sigmask (SIG_SETMASK, &new_mask, &old_mask);
|
||||
return (old_mask);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user