summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohno Crawford <johno@hellface.com>2020-03-18 17:07:11 +0100
committerGitHub <noreply@github.com>2020-03-18 17:07:11 +0100
commit944e27c733840a875987b8f3b44610191ab2a1b6 (patch)
tree22fbe1da5e902a6a7f934d0bc254dff92f9a2d77
parentMerge pull request #24 from Polynomial-C/enable-threads_build_fix (diff)
downloadhaveged-944e27c733840a875987b8f3b44610191ab2a1b6.tar.xz
haveged-944e27c733840a875987b8f3b44610191ab2a1b6.zip
don't use SOCK_CLOEXEC or SOCK_NONBLOCK if not available
Avoids these errors: havegecmd.c: In function ‘cmd_listen’: havegecmd.c:105: error: ‘SOCK_CLOEXEC’ undeclared (first use in this function) havegecmd.c:105: error: (Each undeclared identifier is reported only once havegecmd.c:105: error: for each function it appears in.) havegecmd.c:105: error: ‘SOCK_NONBLOCK’ undeclared (first use in this function) havegecmd.c: In function ‘cmd_connect’: havegecmd.c:154: error: ‘SOCK_CLOEXEC’ undeclared (first use in this function) havegecmd.c:154: error: ‘SOCK_NONBLOCK’ undeclared (first use in this function)
-rw-r--r--src/havegecmd.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/havegecmd.h b/src/havegecmd.h
index 0bc74fd..e928265 100644
--- a/src/havegecmd.h
+++ b/src/havegecmd.h
@@ -33,6 +33,14 @@ extern "C" {
#define HAVEGED_SOCKET_PATH "\0/sys/entropy/haveged"
#define MAGIC_CHROOT 'R'
+
+#ifndef SOCK_CLOEXEC
+#define SOCK_CLOEXEC 0
+#endif
+
+#ifndef SOCK_NONBLOCK
+#define SOCK_NONBLOCK 0
+#endif
/**
* Open and listen on a UNIX socket to get command from there