The symbol being missing has been reported as causing build
failures on OS X. Check for its availability before using it.
---
See
https://www.redhat.com/archives/libvir-list/2016-July/msg00613.html
configure.ac | 4 ++++
src/util/virsystemd.c | 4 ++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 2c81c95..af5d2f8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -402,6 +402,10 @@ AC_CHECK_TYPE([struct sockpeercred],
[], [[#include <sys/socket.h>
]])
+AC_CHECK_DECLS([MSG_NOSIGNAL],
+ [], [], [[#include <sys/socket.h>
+ ]])
+
AC_CHECK_DECLS([ETH_FLAG_TXVLAN, ETH_FLAG_NTUPLE, ETH_FLAG_RXHASH, ETH_FLAG_LRO,
ETHTOOL_GGSO, ETHTOOL_GGRO, ETHTOOL_GFLAGS, ETHTOOL_GFEATURES],
[], [], [[#include <linux/ethtool.h>
diff --git a/src/util/virsystemd.c b/src/util/virsystemd.c
index 969cd68..d2f4bfb 100644
--- a/src/util/virsystemd.c
+++ b/src/util/virsystemd.c
@@ -482,7 +482,7 @@ int virSystemdTerminateMachine(const char *name)
void
virSystemdNotifyStartup(void)
{
-#ifdef HAVE_SYS_UN_H
+#if defined(HAVE_SYS_UN_H) && defined(HAVE_MSG_NOSIGNAL)
const char *path;
const char *msg = "READY=1";
int fd;
@@ -526,7 +526,7 @@ virSystemdNotifyStartup(void)
VIR_WARN("Failed to notify systemd");
VIR_FORCE_CLOSE(fd);
-#endif /* HAVE_SYS_UN_H */
+#endif /* defined(HAVE_SYS_UN_H) && defined(HAVE_MSG_NOSIGNAL) */
}
static int
--
2.7.4