Port signal-handling to DragonFly BSD.
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 1 Jun 2014 23:17:56 +0000 (16:17 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 1 Jun 2014 23:17:56 +0000 (16:17 -0700)
* 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

src/ChangeLog
src/callproc.c
src/process.h
src/sysdep.c
src/syssignal.h

index 050a6f2..975b19f 100644 (file)
@@ -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.
index 0506bf5..38cde01 100644 (file)
@@ -105,30 +105,6 @@ enum
 
 static Lisp_Object call_process (ptrdiff_t, Lisp_Object *, int, ptrdiff_t);
 \f
-
-#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.  */
index 842554b..9181139 100644 (file)
@@ -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);
 
index 573d419..480813e 100644 (file)
@@ -659,7 +659,29 @@ ignore_sigio (void)
   signal (SIGIO, SIG_IGN);
 #endif
 }
+\f
+#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 */
 \f
 /* Saving and restoring the process group of Emacs's terminal.  */
 
index 89d6c48..3fd9730 100644 (file)
@@ -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 *);