Przeglądaj źródła

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

* BSD Detection in network tcp plugin

* BSD Detection in network udp plugin
Holger Jeromin 8 lat temu
rodzic
commit
e94ee24dc6
2 zmienionych plików z 11 dodań i 5 usunięć
  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