aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2014-06-01 16:17:56 -0700
committerPaul Eggert2014-06-01 16:17:56 -0700
commit5c2b9423c56c2b7e3266d34be45cac359d2c3c26 (patch)
tree9cbbfbd6e9b796e480f1e393f2cbf98683596715
parent89187af1bdef9f1f0e2960e4da5f2052c654aa24 (diff)
downloademacs-5c2b9423c56c2b7e3266d34be45cac359d2c3c26.tar.gz
emacs-5c2b9423c56c2b7e3266d34be45cac359d2c3c26.zip
Port signal-handling to DragonFly BSD.
* callproc.c, sysdep.c (block_child_signal, unblock_child_signal): Move implementations from callproc.c to sysdep.c. * process.h, syssignal.h (block_child_signal, unblock_child_signal): Move declaratations from process.h to syssignal.h. Fixes: debbugs:17646
-rw-r--r--src/ChangeLog8
-rw-r--r--src/callproc.c24
-rw-r--r--src/process.h2
-rw-r--r--src/sysdep.c22
-rw-r--r--src/syssignal.h2
5 files changed, 32 insertions, 26 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 050a6f2b0cf..975b19f032f 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,11 @@
12014-06-01 Paul Eggert <eggert@cs.ucla.edu>
2
3 Port signal-handling to DragonFly BSD (Bug#17646).
4 * callproc.c, sysdep.c (block_child_signal, unblock_child_signal):
5 Move implementations from callproc.c to sysdep.c.
6 * process.h, syssignal.h (block_child_signal, unblock_child_signal):
7 Move declaratations from process.h to syssignal.h.
8
12014-06-01 Juanma Barranquero <lekktu@gmail.com> 92014-06-01 Juanma Barranquero <lekktu@gmail.com>
2 10
3 * callint.c (Ffuncall_interactively): Add usage. 11 * callint.c (Ffuncall_interactively): Add usage.
diff --git a/src/callproc.c b/src/callproc.c
index 0506bf53a25..38cde017187 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -105,30 +105,6 @@ enum
105 105
106static Lisp_Object call_process (ptrdiff_t, Lisp_Object *, int, ptrdiff_t); 106static Lisp_Object call_process (ptrdiff_t, Lisp_Object *, int, ptrdiff_t);
107 107
108
109#ifndef MSDOS
110/* Block SIGCHLD. */
111
112void
113block_child_signal (sigset_t *oldset)
114{
115 sigset_t blocked;
116 sigemptyset (&blocked);
117 sigaddset (&blocked, SIGCHLD);
118 sigaddset (&blocked, SIGINT);
119 pthread_sigmask (SIG_BLOCK, &blocked, oldset);
120}
121
122/* Unblock SIGCHLD. */
123
124void
125unblock_child_signal (sigset_t const *oldset)
126{
127 pthread_sigmask (SIG_SETMASK, oldset, 0);
128}
129
130#endif /* !MSDOS */
131
132/* Return the current buffer's working directory, or the home 108/* Return the current buffer's working directory, or the home
133 directory if it's unreachable, as a string suitable for a system call. 109 directory if it's unreachable, as a string suitable for a system call.
134 Signal an error if the result would not be an accessible directory. */ 110 Signal an error if the result would not be an accessible directory. */
diff --git a/src/process.h b/src/process.h
index 842554bdef4..9181139226d 100644
--- a/src/process.h
+++ b/src/process.h
@@ -213,8 +213,6 @@ enum
213 213
214/* Defined in callproc.c. */ 214/* Defined in callproc.c. */
215 215
216extern void block_child_signal (sigset_t *);
217extern void unblock_child_signal (sigset_t const *);
218extern Lisp_Object encode_current_directory (void); 216extern Lisp_Object encode_current_directory (void);
219extern void record_kill_process (struct Lisp_Process *, Lisp_Object); 217extern void record_kill_process (struct Lisp_Process *, Lisp_Object);
220 218
diff --git a/src/sysdep.c b/src/sysdep.c
index 573d419970d..480813e6cbc 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -659,7 +659,29 @@ ignore_sigio (void)
659 signal (SIGIO, SIG_IGN); 659 signal (SIGIO, SIG_IGN);
660#endif 660#endif
661} 661}
662
663#ifndef MSDOS
664/* Block SIGCHLD. */
665
666void
667block_child_signal (sigset_t *oldset)
668{
669 sigset_t blocked;
670 sigemptyset (&blocked);
671 sigaddset (&blocked, SIGCHLD);
672 sigaddset (&blocked, SIGINT);
673 pthread_sigmask (SIG_BLOCK, &blocked, oldset);
674}
675
676/* Unblock SIGCHLD. */
677
678void
679unblock_child_signal (sigset_t const *oldset)
680{
681 pthread_sigmask (SIG_SETMASK, oldset, 0);
682}
662 683
684#endif /* !MSDOS */
663 685
664/* Saving and restoring the process group of Emacs's terminal. */ 686/* Saving and restoring the process group of Emacs's terminal. */
665 687
diff --git a/src/syssignal.h b/src/syssignal.h
index 89d6c480e0c..3fd9730e665 100644
--- a/src/syssignal.h
+++ b/src/syssignal.h
@@ -20,6 +20,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
20#include <signal.h> 20#include <signal.h>
21 21
22extern void init_signals (bool); 22extern void init_signals (bool);
23extern void block_child_signal (sigset_t *);
24extern void unblock_child_signal (sigset_t const *);
23extern void block_tty_out_signal (sigset_t *); 25extern void block_tty_out_signal (sigset_t *);
24extern void unblock_tty_out_signal (sigset_t const *); 26extern void unblock_tty_out_signal (sigset_t const *);
25 27