X-Git-Url: http://git.demorecorder.com/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fxcb_util.c;h=8c18d7156dc6166b9c8fc5401a435a6bdbdb0077;hb=1bbdba52116f127bed3ce812a00240b4009bbf22;hp=3eacc0dab0370dd822561d8ae69ec0d1f9700b12;hpb=9bf8329b50a8edacf00efb074f73c3bb759f7c8d;p=free-sw%2Fxcb%2Flibxcb diff --git a/src/xcb_util.c b/src/xcb_util.c index 3eacc0d..8c18d71 100644 --- a/src/xcb_util.c +++ b/src/xcb_util.c @@ -246,13 +246,16 @@ static int _xcb_open_tcp(char *host, char *protocol, const unsigned short port) static int _xcb_open_unix(char *protocol, const char *file) { int fd; - struct sockaddr_un addr = { AF_UNIX }; + struct sockaddr_un addr; if (protocol && strcmp("unix",protocol)) return -1; strcpy(addr.sun_path, file); - + addr.sun_family = AF_UNIX; +#if HAVE_SOCKADDR_SUN_LEN + addr.sun_len = SUN_LEN(&addr); +#endif fd = socket(AF_UNIX, SOCK_STREAM, 0); if(fd == -1) return -1;