Don't redefine socket() if socket_wrapper is already in use
authorAndrew Bartlett <abartlet@samba.org>
Sat, 2 Oct 2010 10:58:02 +0000 (20:58 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Sat, 2 Oct 2010 10:58:02 +0000 (20:58 +1000)
In Samba, we may have already included socket_wrapper.h at this point

Andrew Bartlett

lib/roken/roken.h.in

index d6e9024bd08d16e1206d5f5eb2b54f083dfd267f..0c0dd20035028a8fc018e64435c1e20bb1e7efe0 100644 (file)
@@ -1072,7 +1072,7 @@ void
 rk_qsort(void *, size_t, size_t, int (*)(const void *, const void *));
 #endif
 
-#if defined(__linux__) && defined(SOCK_CLOEXEC) && !defined(SOCKET_WRAPPER_REPLACE) 
+#if defined(__linux__) && defined(SOCK_CLOEXEC) && !defined(SOCKET_WRAPPER_REPLACE) && !defined(__SOCKET_WRAPPER_H__)
 #undef socket
 #define socket(_fam,_type,_prot) rk_socket(_fam,_type,_prot)
 int ROKEN_LIB_FUNCTION rk_socket(int, int, int);