aboutsummaryrefslogtreecommitdiffstats
path: root/src/frontends/osx
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2015-09-17 17:52:14 +0200
committerTobias Brunner <tobias@strongswan.org>2015-10-29 15:38:37 +0100
commit858148092d1ef755cd40fea0169259e4ad3e9f02 (patch)
tree850f6521d1e5247290f6e4f958a00a481f9f3389 /src/frontends/osx
parentc6aa606a659704d4a4855a6ab1f698fada9dd77e (diff)
downloadstrongswan-858148092d1ef755cd40fea0169259e4ad3e9f02.tar.bz2
strongswan-858148092d1ef755cd40fea0169259e4ad3e9f02.tar.xz
Replace usages of sigwait(3) with sigwaitinfo(2)
This is basically the same call, but it has the advantage of being supported by FreeBSD's valgrind, which sigwait() is not. References #1106.
Diffstat (limited to 'src/frontends/osx')
-rw-r--r--src/frontends/osx/charon-xpc/charon-xpc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/frontends/osx/charon-xpc/charon-xpc.c b/src/frontends/osx/charon-xpc/charon-xpc.c
index 2393c2790..5b8f98e25 100644
--- a/src/frontends/osx/charon-xpc/charon-xpc.c
+++ b/src/frontends/osx/charon-xpc/charon-xpc.c
@@ -19,6 +19,7 @@
#include <stdio.h>
#include <signal.h>
#include <pthread.h>
+#include <errno.h>
#include <library.h>
#include <hydra.h>
@@ -84,9 +85,10 @@ static int run()
{
int sig;
- if (sigwait(&set, &sig))
+ sig = sigwaitinfo(&set, NULL);
+ if (sig == -1)
{
- DBG1(DBG_DMN, "error while waiting for a signal");
+ DBG1(DBG_DMN, "waiting for signal failed: %s", strerror(errno));
return 1;
}
switch (sig)
@@ -206,7 +208,7 @@ int main(int argc, char *argv[])
VERSION, utsname.sysname, utsname.release, utsname.machine);
/* add handler for SEGV and ILL,
- * INT, TERM and HUP are handled by sigwait() in run() */
+ * INT, TERM and HUP are handled by sigwaitinfo() in run() */
action.sa_handler = segv_handler;
action.sa_flags = 0;
sigemptyset(&action.sa_mask);