diff options
| author | Paul Eggert | 2011-07-06 11:04:23 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-07-06 11:04:23 -0700 |
| commit | 123403e42f1a1d556fb33cfd60cbec124d740837 (patch) | |
| tree | b136deab49f587aed6b4f3d583274611b4fbece6 /src | |
| parent | 6db30f83447f4667d2ca84c33979f2745ca96bd5 (diff) | |
| download | emacs-123403e42f1a1d556fb33cfd60cbec124d740837.tar.gz emacs-123403e42f1a1d556fb33cfd60cbec124d740837.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 9 | ||||
| -rw-r--r-- | src/callproc.c | 6 | ||||
| -rw-r--r-- | src/process.c | 6 | ||||
| -rw-r--r-- | src/sysdep.c | 6 |
4 files changed, 18 insertions, 9 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index dc62da2035b..9c73cb9ed85 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2011-07-06 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Use pthread_sigmask, not sigprocmask. | ||
| 4 | * callproc.c (Fcall_process): | ||
| 5 | * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask): | ||
| 6 | * process.c (create_process): | ||
| 7 | sigprocmask is portable only for single-threaded applications, and | ||
| 8 | Emacs can be multi-threaded when it uses GTK. | ||
| 9 | |||
| 1 | 2011-07-05 Jan Djärv <jan.h.d@swipnet.se> | 10 | 2011-07-05 Jan Djärv <jan.h.d@swipnet.se> |
| 2 | 11 | ||
| 3 | * xsettings.c: Use both GConf and GSettings if both are available. | 12 | * xsettings.c: Use both GConf and GSettings if both are available. |
diff --git a/src/callproc.c b/src/callproc.c index b339f343f62..ad3eddbdd39 100644 --- a/src/callproc.c +++ b/src/callproc.c | |||
| @@ -596,7 +596,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 596 | sigemptyset (&blocked); | 596 | sigemptyset (&blocked); |
| 597 | sigaddset (&blocked, SIGPIPE); | 597 | sigaddset (&blocked, SIGPIPE); |
| 598 | sigaction (SIGPIPE, 0, &sigpipe_action); | 598 | sigaction (SIGPIPE, 0, &sigpipe_action); |
| 599 | sigprocmask (SIG_BLOCK, &blocked, &procmask); | 599 | pthread_sigmask (SIG_BLOCK, &blocked, &procmask); |
| 600 | #endif | 600 | #endif |
| 601 | 601 | ||
| 602 | BLOCK_INPUT; | 602 | BLOCK_INPUT; |
| @@ -633,7 +633,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 633 | in the child. */ | 633 | in the child. */ |
| 634 | //signal (SIGPIPE, SIG_DFL); | 634 | //signal (SIGPIPE, SIG_DFL); |
| 635 | #ifdef HAVE_WORKING_VFORK | 635 | #ifdef HAVE_WORKING_VFORK |
| 636 | sigprocmask (SIG_SETMASK, &procmask, 0); | 636 | pthread_sigmask (SIG_SETMASK, &procmask, 0); |
| 637 | #endif | 637 | #endif |
| 638 | 638 | ||
| 639 | child_setup (filefd, fd1, fd_error, (char **) new_argv, | 639 | child_setup (filefd, fd1, fd_error, (char **) new_argv, |
| @@ -645,7 +645,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 645 | #ifdef HAVE_WORKING_VFORK | 645 | #ifdef HAVE_WORKING_VFORK |
| 646 | /* Restore the signal state. */ | 646 | /* Restore the signal state. */ |
| 647 | sigaction (SIGPIPE, &sigpipe_action, 0); | 647 | sigaction (SIGPIPE, &sigpipe_action, 0); |
| 648 | sigprocmask (SIG_SETMASK, &procmask, 0); | 648 | pthread_sigmask (SIG_SETMASK, &procmask, 0); |
| 649 | #endif | 649 | #endif |
| 650 | 650 | ||
| 651 | #endif /* not WINDOWSNT */ | 651 | #endif /* not WINDOWSNT */ |
diff --git a/src/process.c b/src/process.c index 6bd168d8840..1a884357b86 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -1652,7 +1652,7 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir) | |||
| 1652 | sigaddset (&blocked, SIGHUP ); sigaction (SIGHUP , 0, &sighup_action ); | 1652 | sigaddset (&blocked, SIGHUP ); sigaction (SIGHUP , 0, &sighup_action ); |
| 1653 | #endif | 1653 | #endif |
| 1654 | #endif /* HAVE_WORKING_VFORK */ | 1654 | #endif /* HAVE_WORKING_VFORK */ |
| 1655 | sigprocmask (SIG_BLOCK, &blocked, &procmask); | 1655 | pthread_sigmask (SIG_BLOCK, &blocked, &procmask); |
| 1656 | 1656 | ||
| 1657 | FD_SET (inchannel, &input_wait_mask); | 1657 | FD_SET (inchannel, &input_wait_mask); |
| 1658 | FD_SET (inchannel, &non_keyboard_wait_mask); | 1658 | FD_SET (inchannel, &non_keyboard_wait_mask); |
| @@ -1808,7 +1808,7 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir) | |||
| 1808 | signal (SIGPIPE, SIG_DFL); | 1808 | signal (SIGPIPE, SIG_DFL); |
| 1809 | 1809 | ||
| 1810 | /* Stop blocking signals in the child. */ | 1810 | /* Stop blocking signals in the child. */ |
| 1811 | sigprocmask (SIG_SETMASK, &procmask, 0); | 1811 | pthread_sigmask (SIG_SETMASK, &procmask, 0); |
| 1812 | 1812 | ||
| 1813 | if (pty_flag) | 1813 | if (pty_flag) |
| 1814 | child_setup_tty (xforkout); | 1814 | child_setup_tty (xforkout); |
| @@ -1900,7 +1900,7 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir) | |||
| 1900 | #endif | 1900 | #endif |
| 1901 | #endif /* HAVE_WORKING_VFORK */ | 1901 | #endif /* HAVE_WORKING_VFORK */ |
| 1902 | /* Stop blocking signals in the parent. */ | 1902 | /* Stop blocking signals in the parent. */ |
| 1903 | sigprocmask (SIG_SETMASK, &procmask, 0); | 1903 | pthread_sigmask (SIG_SETMASK, &procmask, 0); |
| 1904 | 1904 | ||
| 1905 | /* Now generate the error if vfork failed. */ | 1905 | /* Now generate the error if vfork failed. */ |
| 1906 | if (pid < 0) | 1906 | if (pid < 0) |
diff --git a/src/sysdep.c b/src/sysdep.c index 8b6939b91fe..46667cf292f 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -1534,7 +1534,7 @@ sigset_t | |||
| 1534 | sys_sigblock (sigset_t new_mask) | 1534 | sys_sigblock (sigset_t new_mask) |
| 1535 | { | 1535 | { |
| 1536 | sigset_t old_mask; | 1536 | sigset_t old_mask; |
| 1537 | sigprocmask (SIG_BLOCK, &new_mask, &old_mask); | 1537 | pthread_sigmask (SIG_BLOCK, &new_mask, &old_mask); |
| 1538 | return (old_mask); | 1538 | return (old_mask); |
| 1539 | } | 1539 | } |
| 1540 | 1540 | ||
| @@ -1542,7 +1542,7 @@ sigset_t | |||
| 1542 | sys_sigunblock (sigset_t new_mask) | 1542 | sys_sigunblock (sigset_t new_mask) |
| 1543 | { | 1543 | { |
| 1544 | sigset_t old_mask; | 1544 | sigset_t old_mask; |
| 1545 | sigprocmask (SIG_UNBLOCK, &new_mask, &old_mask); | 1545 | pthread_sigmask (SIG_UNBLOCK, &new_mask, &old_mask); |
| 1546 | return (old_mask); | 1546 | return (old_mask); |
| 1547 | } | 1547 | } |
| 1548 | 1548 | ||
| @@ -1550,7 +1550,7 @@ sigset_t | |||
| 1550 | sys_sigsetmask (sigset_t new_mask) | 1550 | sys_sigsetmask (sigset_t new_mask) |
| 1551 | { | 1551 | { |
| 1552 | sigset_t old_mask; | 1552 | sigset_t old_mask; |
| 1553 | sigprocmask (SIG_SETMASK, &new_mask, &old_mask); | 1553 | pthread_sigmask (SIG_SETMASK, &new_mask, &old_mask); |
| 1554 | return (old_mask); | 1554 | return (old_mask); |
| 1555 | } | 1555 | } |
| 1556 | 1556 | ||