summaryrefslogtreecommitdiff
path: root/devel/mongo-c-driver/files/patch-env-c
blob: 773f6df5f188e2d078540103e4b747345721bd5a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
--- src/env.c.orig	2013-01-26 10:53:37.000000000 -0800
+++ src/env.c	2013-01-26 10:20:49.000000000 -0800
@@ -1,3 +1,7 @@
+#if (defined(__unix__) || defined(unix)) && !defined(USG)
+#include <sys/param.h>
+#endif
+
 #if !defined(MONGO_ENV_STANDARD) && (defined(_WIN32) || defined(_WIN64))
 
 /* env_win32.c */
@@ -34,6 +38,7 @@
 # define NI_MAXSERV 32
 #endif
 
+
 int mongo_env_close_socket( int socket ) {
     return closesocket( socket );
 }
@@ -179,7 +184,7 @@
 }
 
 
-#elif !defined(MONGO_ENV_STANDARD) && (defined(__APPLE__) || defined(__linux) || defined(__unix) || defined(__posix))
+#elif !defined(MONGO_ENV_STANDARD) && (defined(__APPLE__) || defined(__linux) || defined(__unix) || defined(__posix) || defined(BSD))
 
 /* env_posix.c */
 
@@ -227,7 +232,7 @@
 
 int mongo_env_write_socket( mongo *conn, const void *buf, size_t len ) {
     const char *cbuf = buf;
-#ifdef __APPLE__
+#if defined (__APPLE__) || defined(BSD)
     int flags = 0;
 #else
     int flags = MSG_NOSIGNAL;
@@ -357,7 +362,7 @@
             conn->sock = 0;
             continue;
         }
-#if __APPLE__
+#if __APPLE__ 
         {
             int flag = 1;
             setsockopt( conn->sock, SOL_SOCKET, SO_NOSIGPIPE,
@@ -448,7 +453,7 @@
 #ifdef _WIN32
     int flags = 0;
 #else
-#ifdef __APPLE__
+#ifdef __APPLE__ || BSD
     int flags = 0;
 #else
     int flags = MSG_NOSIGNAL;