d7bc8d0
diff -up libxcb-1.1.91/src/xcb_util.c.abstract libxcb-1.1.91/src/xcb_util.c
d7bc8d0
--- libxcb-1.1.91/src/xcb_util.c.abstract	2008-07-13 07:42:41.000000000 -0400
d7bc8d0
+++ libxcb-1.1.91/src/xcb_util.c	2008-09-10 17:23:10.000000000 -0400
d7bc8d0
@@ -36,6 +36,7 @@
d7bc8d0
 #endif
d7bc8d0
 #include <netdb.h>
d7bc8d0
 #include <errno.h>
d7bc8d0
+#include <stddef.h>
d7bc8d0
 #include <stdio.h>
d7bc8d0
 #include <stdlib.h>
d7bc8d0
 #include <unistd.h>
d7bc8d0
@@ -251,6 +252,14 @@ static int _xcb_open_unix(char *protocol
3bf5959
     if (protocol && strcmp("unix",protocol))
3bf5959
         return -1;
3bf5959
 
b6f56cd
+    memset(&addr, 0, sizeof(addr));
b6f56cd
+    addr.sun_family = AF_UNIX;
b6f56cd
+
b6f56cd
+    /* try the abstract socket first */
b6f56cd
+    strcpy(addr.sun_path + 1, file);
d7bc8d0
+    if(connect(fd, (struct sockaddr *) &addr, strlen(file) + 1 + offsetof(struct sockaddr_un, sun_path)) != -1)
b6f56cd
+        return fd;
b6f56cd
+
d7bc8d0
     strcpy(addr.sun_path, file);
d7bc8d0
     addr.sun_family = AF_UNIX;
d7bc8d0
 #if HAVE_SOCKADDR_SUN_LEN