[Mesa-dev] [PATCH] gallium/auxiliary/util: PIPE_OS_BSD supports sockets

Tobias Nygren tnn at NetBSD.org
Fri Apr 17 11:26:40 PDT 2015


Signed-off-by: Tobias Nygren <tnn at NetBSD.org>
---
 src/gallium/auxiliary/util/u_network.c | 9 ++++++---
 src/gallium/auxiliary/util/u_network.h | 3 ++-
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_network.c b/src/gallium/auxiliary/util/u_network.c
index 45b3691..a5465cf 100644
--- a/src/gallium/auxiliary/util/u_network.c
+++ b/src/gallium/auxiliary/util/u_network.c
@@ -7,7 +7,8 @@
 #  include <winsock2.h>
 #  include <windows.h>
 #elif defined(PIPE_OS_LINUX) || defined(PIPE_OS_HAIKU) || \
-   defined(PIPE_OS_APPLE) || defined(PIPE_OS_CYGWIN) || defined(PIPE_OS_SOLARIS)
+   defined(PIPE_OS_APPLE) || defined(PIPE_OS_CYGWIN) || \
+   defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_BSD)
 #  include <sys/socket.h>
 #  include <netinet/in.h>
 #  include <unistd.h>
@@ -56,7 +57,8 @@ u_socket_close(int s)
       return;
 
 #if defined(PIPE_OS_LINUX) || defined(PIPE_OS_HAIKU) \
-    || defined(PIPE_OS_APPLE) || defined(PIPE_OS_SOLARIS)
+    || defined(PIPE_OS_APPLE) || defined(PIPE_OS_SOLARIS) \
+    || defined(PIPE_OS_BSD)
    shutdown(s, SHUT_RDWR);
    close(s);
 #elif defined(PIPE_SUBSYSTEM_WINDOWS_USER)
@@ -172,7 +174,8 @@ void
 u_socket_block(int s, boolean block)
 {
 #if defined(PIPE_OS_LINUX) || defined(PIPE_OS_HAIKU) \
-    || defined(PIPE_OS_APPLE) || defined(PIPE_OS_SOLARIS)
+    || defined(PIPE_OS_APPLE) || defined(PIPE_OS_SOLARIS) \
+    || defined(PIPE_OS_BSD)
    int old = fcntl(s, F_GETFL, 0);
    if (old == -1)
       return;
diff --git a/src/gallium/auxiliary/util/u_network.h b/src/gallium/auxiliary/util/u_network.h
index 61fe9a3..4141e69 100644
--- a/src/gallium/auxiliary/util/u_network.h
+++ b/src/gallium/auxiliary/util/u_network.h
@@ -7,7 +7,8 @@
 #if defined(PIPE_SUBSYSTEM_WINDOWS_USER)
 #  define PIPE_HAVE_SOCKETS
 #elif defined(PIPE_OS_LINUX) || defined(PIPE_OS_HAIKU) || \
-    defined(PIPE_OS_APPLE) || defined(PIPE_OS_SOLARIS)
+    defined(PIPE_OS_APPLE) || defined(PIPE_OS_SOLARIS) || \
+    defined(PIPE_OS_BSD)
 #  define PIPE_HAVE_SOCKETS
 #endif
 
-- 
2.3.5



More information about the mesa-dev mailing list