summaryrefslogtreecommitdiff
path: root/app/xsm/signals.c
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2018-05-21 18:33:53 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2018-05-21 18:33:53 +0000
commitf141652da4323e3badd2fef390c108f920ec7bfc (patch)
treea241e3bdc91e700509e7cccaf4e4faae34138615 /app/xsm/signals.c
parent9bb7198e6ef96a6cef3efb5ed075557fbc3987e7 (diff)
Update to xsm 1.0.4
Diffstat (limited to 'app/xsm/signals.c')
-rw-r--r--app/xsm/signals.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/app/xsm/signals.c b/app/xsm/signals.c
index 53a016807..55600c686 100644
--- a/app/xsm/signals.c
+++ b/app/xsm/signals.c
@@ -74,12 +74,6 @@ in this Software without prior written authorization from The Open Group.
#include "list.h"
#include "save.h"
-#if defined(X_NOT_POSIX) && defined(SIGNALRETURNSINT)
-#define SIGVAL int
-#else
-#define SIGVAL void
-#endif
-
#ifndef X_NOT_POSIX
#define USE_POSIX_WAIT
#endif
@@ -103,8 +97,8 @@ in this Software without prior written authorization from The Open Group.
int checkpoint_from_signal = 0;
-static SIGVAL
-Signal(int sig, SIGVAL (*handler)(int))
+static void
+Signal(int sig, void (*handler)(int))
{
#ifndef X_NOT_POSIX
struct sigaction sigact, osigact;
@@ -112,13 +106,7 @@ Signal(int sig, SIGVAL (*handler)(int))
sigemptyset(&sigact.sa_mask);
sigact.sa_flags = 0;
sigaction(sig, &sigact, &osigact);
-# if defined(SIGNALRETURNSINT)
- return osigact.sa_handler;
-# endif
#else
-# if defined(SIGNALRETURNSINT)
- return
-# endif
signal(sig, handler);
#endif
}
@@ -130,8 +118,7 @@ sig_child_handler (int sig)
{
int pid, olderrno = errno;
-#if !defined(USE_POSIX_WAIT) && (defined(USE_SYSV_SIGNALS) && \
- (defined(CRAY) || !defined(SIGTSTP)))
+#if !defined(USE_POSIX_WAIT) && defined(USE_SYSV_SIGNALS) && !defined(SIGTSTP)
wait (NULL);
#endif
@@ -151,7 +138,7 @@ sig_child_handler (int sig)
#ifdef USE_POSIX_WAIT
pid = waitpid (-1, NULL, WNOHANG);
#else
-#if defined(USE_SYSV_SIGNALS) && (defined(CRAY) || !defined(SIGTSTP))
+#if defined(USE_SYSV_SIGNALS) && !defined(SIGTSTP)
/* cannot do non-blocking wait */
pid = 0;
#else
@@ -260,7 +247,7 @@ execute_system_command (char *s)
Signal (SIGCHLD, sig_child_handler);
-#if !(defined(USE_SYSV_SIGNALS) && (defined(CRAY) || !defined(SIGTSTP)))
+#if !(defined(USE_SYSV_SIGNALS) && !defined(SIGTSTP))
do
{
union wait status;