On darwin NO_MSGSIGNAL and SIGPOLL, don't exist, so SO_NOSIGPIPE will be used 
instead, which serves the same function.

>From a61c9634831e5aff6cd020148516337dd4f8090f Mon Sep 17 00:00:00 2001
From: Cameron Katri <katri.came...@gmail.com>
Date: Mon, 31 Aug 2020 09:50:09 -0400
Subject: [PATCH] Fix compilation on Darwin

---
 lib/libalpm/util.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c
index b70a8192..f7d40b78 100644
--- a/lib/libalpm/util.c
+++ b/lib/libalpm/util.c
@@ -34,6 +34,11 @@
 #include <fnmatch.h>
 #include <poll.h>
 
+/* no MSG_NOSIGNAL support */
+#ifndef MSG_NOSIGNAL
+#define MSG_NOSIGNAL 0x1022
+#endif
+
 /* libarchive */
 #include <archive.h>
 #include <archive_entry.h>
@@ -557,8 +562,11 @@ static void _alpm_reset_signals(void)
        int *i, signals[] = {
                SIGABRT, SIGALRM, SIGBUS, SIGCHLD, SIGCONT, SIGFPE, SIGHUP, 
SIGILL,
                SIGINT, SIGKILL, SIGPIPE, SIGQUIT, SIGSEGV, SIGSTOP, SIGTERM, 
SIGTSTP,
-               SIGTTIN, SIGTTOU, SIGUSR1, SIGUSR2, SIGPOLL, SIGPROF, SIGSYS, 
SIGTRAP,
+               SIGTTIN, SIGTTOU, SIGUSR1, SIGUSR2, SIGPROF, SIGSYS, SIGTRAP,
                SIGURG, SIGVTALRM, SIGXCPU, SIGXFSZ,
+#ifndef __APPLE__
+               SIGPOLL,
+#endif
                0
        };
        struct sigaction def;
-- 
2.28.0

Reply via email to