summaryrefslogtreecommitdiff
path: root/src/sysdep.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sysdep.c')
-rw-r--r--src/sysdep.c44
1 files changed, 33 insertions, 11 deletions
diff --git a/src/sysdep.c b/src/sysdep.c
index e1fd86f5f3b..2eedd1fc6cb 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -128,7 +128,7 @@ static const int baud_convert[] =
/* Return the current working directory. Returns NULL on errors.
Any other returned value must be freed with free. This is used
only when get_current_dir_name is not defined on the system. */
-char*
+char *
get_current_dir_name (void)
{
char *buf;
@@ -255,7 +255,7 @@ init_baud_rate (int fd)
#endif /* not DOS_NT */
}
- baud_rate = (emacs_ospeed < sizeof baud_convert / sizeof baud_convert[0]
+ baud_rate = (emacs_ospeed < ARRAYELTS (baud_convert)
? baud_convert[emacs_ospeed] : 9600);
if (baud_rate == 0)
baud_rate = 1200;
@@ -603,6 +603,7 @@ init_sigio (int fd)
#endif
}
+#ifndef DOS_NT
static void
reset_sigio (int fd)
{
@@ -610,6 +611,7 @@ reset_sigio (int fd)
fcntl (fd, F_SETFL, old_fcntl_flags[fd]);
#endif
}
+#endif
void
request_sigio (void)
@@ -657,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. */
@@ -692,21 +716,21 @@ init_foreground_group (void)
/* Block and unblock SIGTTOU. */
void
-block_tty_out_signal (void)
+block_tty_out_signal (sigset_t *oldset)
{
#ifdef SIGTTOU
sigset_t blocked;
sigemptyset (&blocked);
sigaddset (&blocked, SIGTTOU);
- pthread_sigmask (SIG_BLOCK, &blocked, 0);
+ pthread_sigmask (SIG_BLOCK, &blocked, oldset);
#endif
}
void
-unblock_tty_out_signal (void)
+unblock_tty_out_signal (sigset_t const *oldset)
{
#ifdef SIGTTOU
- pthread_sigmask (SIG_SETMASK, &empty_mask, 0);
+ pthread_sigmask (SIG_SETMASK, oldset, 0);
#endif
}
@@ -721,10 +745,11 @@ static void
tcsetpgrp_without_stopping (int fd, pid_t pgid)
{
#ifdef SIGTTOU
+ sigset_t oldset;
block_input ();
- block_tty_out_signal ();
+ block_tty_out_signal (&oldset);
tcsetpgrp (fd, pgid);
- unblock_tty_out_signal ();
+ unblock_tty_out_signal (&oldset);
unblock_input ();
#endif
}
@@ -1527,9 +1552,6 @@ emacs_sigaction_init (struct sigaction *action, signal_handler_t handler)
#endif
}
- if (! IEEE_FLOATING_POINT)
- sigaddset (&action->sa_mask, SIGFPE);
-
action->sa_handler = handler;
action->sa_flags = emacs_sigaction_flags ();
}