diff -Naur libxcb-1.6/configure.ac libxcb-1.6-haiku/configure.ac
--- libxcb-1.6/configure.ac	2010-04-09 14:55:28.066584576 +0000
+++ libxcb-1.6-haiku/configure.ac	2010-05-03 01:14:47.611844096 +0000
@@ -69,8 +69,8 @@
 AC_SUBST(XCBPROTO_XCBPYTHONDIR)
 
 AC_HEADER_STDC
-AC_SEARCH_LIBS(getaddrinfo, socket)
-AC_SEARCH_LIBS(connect, socket)
+AC_SEARCH_LIBS(getaddrinfo, [network socket])
+AC_SEARCH_LIBS(connect, [network socket])
 
 case $host_os in
 linux*)
diff -Naur libxcb-1.6/src/xcb_util.c libxcb-1.6-haiku/src/xcb_util.c
--- libxcb-1.6/src/xcb_util.c	2010-04-09 14:54:58.006291456 +0000
+++ libxcb-1.6-haiku/src/xcb_util.c	2010-05-03 01:16:27.084672512 +0000
@@ -300,7 +300,7 @@
     strcpy(addr.sun_path, file);
     addr.sun_family = AF_UNIX;
 #ifdef HAVE_SOCKADDR_SUN_LEN
-    addr.sun_len = SUN_LEN(&addr);
+    addr.sun_len = sizeof(&addr);
 #endif
     fd = _xcb_socket(AF_UNIX, SOCK_STREAM, 0);
     if(fd == -1)
