Explorar el Código

Generic BSD detection for tcp/udp plugin (#807)

* BSD Detection in network tcp plugin

* BSD Detection in network udp plugin
Holger Jeromin hace 8 años
padre
commit
e94ee24dc6
Se han modificado 2 ficheros con 11 adiciones y 5 borrados
  1. 5 2
      plugins/ua_network_tcp.c
  2. 6 3
      plugins/ua_network_udp.c

+ 5 - 2
plugins/ua_network_tcp.c

@@ -42,9 +42,12 @@
 # ifdef __QNX__
 #  include <sys/socket.h>
 # endif
-# ifdef __OpenBSD__
-#  include <sys/socket.h>
+#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
+# include <sys/param.h>
+# if defined(BSD)
+#  include<sys/socket.h>
 # endif
+#endif
 # ifndef __CYGWIN__
 #  include <netinet/tcp.h>
 # endif

+ 6 - 3
plugins/ua_network_udp.c

@@ -24,9 +24,12 @@
 #ifdef __QNX__
 #include <sys/socket.h>
 #endif
-#ifdef __OpenBSD__
-#include <sys/socket.h>
-#endif 
+#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
+# include <sys/param.h>
+# if defined(BSD)
+#  include<sys/socket.h>
+# endif
+#endif
 # define CLOSESOCKET(S) close(S)
 
 #define MAXBACKLOG 100