libreplace: undef AI_ADDRCONFIG on QNX 6.3.0 (fix bug #6630)
authorMatt Kraai <mkraai@beckman.com>
Wed, 12 Aug 2009 06:49:24 +0000 (08:49 +0200)
committerStefan Metzmacher <metze@samba.org>
Wed, 12 Aug 2009 11:27:39 +0000 (13:27 +0200)
Some of the functions in source3/lib/util_sock.c use AI_ADDRCONFIG.  On QNX
6.3.0, this macro is defined but, if it's used, getaddrinfo will fail.  This
prevents smbd from opening any sockets.

If I undefine AI_ADDRCONFIG on such systems and allow
lib/replace/system/network.h to define it to be 0, this works around the issue.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
lib/replace/system/network.h

index c8364101a9ff3c9380098ebeb9e7ae8cde33dac0..1f510350bd97ca129c55d38577a67be84a4aec10 100644 (file)
@@ -195,6 +195,20 @@ int rep_socketpair(int d, int type, int protocol, int sv[2]);
 #endif
 #endif
 
+/*
+ * Some of the functions in source3/lib/util_sock.c use AI_ADDRCONFIG. On QNX
+ * 6.3.0, this macro is defined but, if it's used, getaddrinfo will fail. This
+ * prevents smbd from opening any sockets.
+ *
+ * If I undefine AI_ADDRCONFIG on such systems and define it to be 0,
+ * this works around the issue.
+ */
+#ifdef __QNX__
+#include <sys/neutrino.h>
+#if _NTO_VERSION == 630
+#undef AI_ADDRCONFIG
+#endif
+#endif
 #ifndef AI_ADDRCONFIG
 /*
  * logic copied from AI_NUMERICHOST