summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2014-06-01 16:17:56 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2014-06-01 16:17:56 -0700
commit5c2b9423c56c2b7e3266d34be45cac359d2c3c26 (patch)
tree9cbbfbd6e9b796e480f1e393f2cbf98683596715
parent89187af1bdef9f1f0e2960e4da5f2052c654aa24 (diff)
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 050a6f2b0c..975b19f032 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,11 @@
+2014-06-01 Paul Eggert <eggert@cs.ucla.edu>
+
+ Port signal-handling to DragonFly BSD (Bug#17646).
+ * 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.
+
2014-06-01 Juanma Barranquero <lekktu@gmail.com>
* callint.c (Ffuncall_interactively): Add usage.
diff --git a/src/callproc.c b/src/callproc.c
index 0506bf53a2..38cde01718 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -105,30 +105,6 @@ enum
static Lisp_Object call_process (ptrdiff_t, Lisp_Object *, int, ptrdiff_t);
-
-#ifndef MSDOS
-/* Block SIGCHLD. */
-
-void
-block_child_signal (sigset_t *oldset)
-{
- sigset_t blocked;
- sigemptyset (&blocked);
- sigaddset (&blocked, SIGCHLD);
- sigaddset (&blocked, SIGINT);
- pthread_sigmask (SIG_BLOCK, &blocked, oldset);
-}
-
-/* Unblock SIGCHLD. */
-
-void
-unblock_child_signal (sigset_t const *oldset)
-{
- pthread_sigmask (SIG_SETMASK, oldset, 0);
-}
-
-#endif /* !MSDOS */
-
/* Return the current buffer's working directory, or the home
directory if it's unreachable, as a string suitable for a system call.
Signal an error if the result would not be an accessible directory. */
diff --git a/src/process.h b/src/process.h
index 842554bdef..9181139226 100644
--- a/src/process.h
+++ b/src/process.h
@@ -213,8 +213,6 @@ enum
/* Defined in callproc.c. */
-extern void block_child_signal (sigset_t *);
-extern void unblock_child_signal (sigset_t const *);
extern Lisp_Object encode_current_directory (void);
extern void record_kill_process (struct Lisp_Process *, Lisp_Object);
diff --git a/src/sysdep.c b/src/sysdep.c
index 573d419970..480813e6cb 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -659,7 +659,29 @@ ignore_sigio (void)
signal (SIGIO, SIG_IGN);
#endif
}
+
+#ifndef MSDOS
+/* Block SIGCHLD. */
+
+void
+block_child_signal (sigset_t *oldset)
+{
+ sigset_t blocked;
+ sigemptyset (&blocked);
+ sigaddset (&blocked, SIGCHLD);
+ sigaddset (&blocked, SIGINT);
+ pthread_sigmask (SIG_BLOCK, &blocked, oldset);
+}
+
+/* Unblock SIGCHLD. */
+
+void
+unblock_child_signal (sigset_t const *oldset)
+{
+ pthread_sigmask (SIG_SETMASK, oldset, 0);
+}
+#endif /* !MSDOS */
/* Saving and restoring the process group of Emacs's terminal. */
diff --git a/src/syssignal.h b/src/syssignal.h
index 89d6c480e0..3fd9730e66 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/>. */
#include <signal.h>
extern void init_signals (bool);
+extern void block_child_signal (sigset_t *);
+extern void unblock_child_signal (sigset_t const *);
extern void block_tty_out_signal (sigset_t *);
extern void unblock_tty_out_signal (sigset_t const *);