diff options
| author | Paul Eggert | 2011-07-08 13:39:30 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-07-08 13:39:30 -0700 |
| commit | 1301ac268f19a6ab60d4b43c18bd00393a12a0db (patch) | |
| tree | a56c1472c22c6a59ccac090e58715994ef275bb3 /src | |
| parent | 1b85461891d3354aef97bec97fab891ddb24e06e (diff) | |
| parent | 67517972df013491db07d81f516c7e56ddc214c8 (diff) | |
| download | emacs-1301ac268f19a6ab60d4b43c18bd00393a12a0db.tar.gz emacs-1301ac268f19a6ab60d4b43c18bd00393a12a0db.zip | |
Merge: Use pthread_sigmask, not sigprocmask (Bug#9010).
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 12 | ||||
| -rw-r--r-- | src/Makefile.in | 4 | ||||
| -rw-r--r-- | src/callproc.c | 6 | ||||
| -rw-r--r-- | src/process.c | 6 | ||||
| -rw-r--r-- | src/sysdep.c | 6 |
5 files changed, 24 insertions, 10 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 52b6bf15e1d..3cf90d10289 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,15 @@ | |||
| 1 | 2011-07-08 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Use pthread_sigmask, not sigprocmask (Bug#9010). | ||
| 4 | sigprocmask is portable only for single-threaded applications, and | ||
| 5 | Emacs can be multi-threaded when it uses GTK. | ||
| 6 | * Makefile.in (LIB_PTHREAD_SIGMASK): New macro. | ||
| 7 | (LIBES): Use it. | ||
| 8 | * callproc.c (Fcall_process): | ||
| 9 | * process.c (create_process): | ||
| 10 | * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask): | ||
| 11 | Use pthread_sigmask, not sigprocmask. | ||
| 12 | |||
| 1 | 2011-07-08 Jan Djärv <jan.h.d@swipnet.se> | 13 | 2011-07-08 Jan Djärv <jan.h.d@swipnet.se> |
| 2 | 14 | ||
| 3 | * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget. | 15 | * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget. |
diff --git a/src/Makefile.in b/src/Makefile.in index f628c321f70..f68fa5c2240 100644 --- a/src/Makefile.in +++ b/src/Makefile.in | |||
| @@ -269,6 +269,8 @@ LIBSELINUX_LIBS = @LIBSELINUX_LIBS@ | |||
| 269 | LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ | 269 | LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ |
| 270 | LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ | 270 | LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ |
| 271 | 271 | ||
| 272 | LIB_PTHREAD_SIGMASK = @LIB_PTHREAD_SIGMASK@ | ||
| 273 | |||
| 272 | INTERVALS_H = dispextern.h intervals.h composite.h | 274 | INTERVALS_H = dispextern.h intervals.h composite.h |
| 273 | 275 | ||
| 274 | GETLOADAVG_LIBS = @GETLOADAVG_LIBS@ | 276 | GETLOADAVG_LIBS = @GETLOADAVG_LIBS@ |
| @@ -383,7 +385,7 @@ LIBES = $(LIBS) $(LIBX_BASE) $(LIBX_OTHER) $(LIBSOUND) \ | |||
| 383 | $(LIBXML2_LIBS) $(LIBGPM) $(LIBRESOLV) $(LIBS_SYSTEM) \ | 385 | $(LIBXML2_LIBS) $(LIBGPM) $(LIBRESOLV) $(LIBS_SYSTEM) \ |
| 384 | $(LIBS_TERMCAP) $(GETLOADAVG_LIBS) $(SETTINGS_LIBS) $(LIBSELINUX_LIBS) \ | 386 | $(LIBS_TERMCAP) $(GETLOADAVG_LIBS) $(SETTINGS_LIBS) $(LIBSELINUX_LIBS) \ |
| 385 | $(FREETYPE_LIBS) $(FONTCONFIG_LIBS) $(LIBOTF_LIBS) $(M17N_FLT_LIBS) \ | 387 | $(FREETYPE_LIBS) $(FONTCONFIG_LIBS) $(LIBOTF_LIBS) $(M17N_FLT_LIBS) \ |
| 386 | $(LIBGNUTLS_LIBS) \ | 388 | $(LIBGNUTLS_LIBS) $(LIB_PTHREAD_SIGMASK) \ |
| 387 | $(LIB_GCC) $(LIB_MATH) $(LIB_STANDARD) $(LIB_GCC) | 389 | $(LIB_GCC) $(LIB_MATH) $(LIB_STANDARD) $(LIB_GCC) |
| 388 | 390 | ||
| 389 | all: emacs$(EXEEXT) $(OTHER_FILES) | 391 | all: emacs$(EXEEXT) $(OTHER_FILES) |
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 | ||