From 7f6666b3dd4e3934c8420a0d2125caefcbdf00de Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?=
 <grubba@grubba.org>
Date: Wed, 12 Jul 2017 11:12:39 +0200
Subject: [PATCH] Revert "build: removed unused enum that evaluates to empty on
 NetBSD."

This reverts commit 5ca5bed0553acee59db65699e0547fb63db809a3.

The enum as such is not used, but its values are...

Fixes compilation errors on Solaris and other platforms without accept4(2).
---
 src/fd_control.h | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/src/fd_control.h b/src/fd_control.h
index 3ade6bc8e7..1853722648 100644
--- a/src/fd_control.h
+++ b/src/fd_control.h
@@ -11,6 +11,31 @@
 #ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #endif
+
+/* NB: The default values are compatible with Linux,
+ *     but should work on other OSs as well, since
+ *     accept4(2) is emulated by us anyway.
+ */
+enum pike_sock_flags {
+#ifndef SOCK_CLOEXEC
+#if !defined(SOCK_NONBLOCK) || (SOCK_NONBLOCK != 0x80000)
+  SOCK_CLOEXEC = 0x80000,
+#else
+  /* Unlikely, but... */
+  SOCK_CLOEXEC = 0x40000,
+#endif /* !SOCK_NONBLOCK || SOCK_NONBLOCK != 0x80000 */
+#define SOCK_CLOEXEC	SOCK_CLOEXEC
+#endif
+#ifndef SOCK_NONBLOCK
+#if (SOCK_CLOEXEC != 0x00800)
+  SOCK_NONBLOCK = 0x00800,
+#else
+  /* Unlikely, but... */
+  SOCK_NONBLOCK = 0x00400,
+#endif
+#define SOCK_NONBLOCK	SOCK_NONBLOCK
+#endif
+};
 #endif /* !HAVE_ACCEPT4 */
 
 /* Prototypes begin here */
-- 
GitLab