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
This commit is contained in:
Paul Eggert 2014-06-01 16:17:56 -07:00
parent 89187af1bd
commit 5c2b9423c5
5 changed files with 32 additions and 26 deletions

View 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.

View file

@ -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. */

View 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);

View file

@ -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. */

View 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 *);