X-Git-Url: http://git.demorecorder.com/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fxcb_util.c;h=1bde7b79c86d3a6586a624e104d3e7a6ff626e2b;hb=4f25ee16443b29e1a25bd26a724e1e0a577e21ff;hp=ad9b3df7c9e693112ad9f922a3d67c7d072d7b74;hpb=4b502dd696cf7f59a961bcf71c9255ae28f0765a;p=free-sw%2Fxcb%2Flibxcb diff --git a/src/xcb_util.c b/src/xcb_util.c index ad9b3df..1bde7b7 100644 --- a/src/xcb_util.c +++ b/src/xcb_util.c @@ -171,22 +171,20 @@ static int _xcb_open(const char *host, char *protocol, const int display) int actual_filelen; #ifdef HAVE_LAUNCHD - if(strncmp(host, "/tmp/launch", 11) == 0) { - base = host; - host = ""; - protocol = NULL; - } + if(strncmp(host, "/tmp/launch", 11) == 0) { + base = host; + host = ""; + protocol = NULL; + } #endif - if(*host || protocol) + /* If protocol or host is "unix", fall through to Unix socket code below */ + if ((!protocol || (strcmp("unix",protocol) != 0)) && + (*host != '\0') && (strcmp("unix",host) != 0)) { - if (protocol - || strcmp("unix",host)) { /* follow the old unix: rule */ - - /* display specifies TCP */ - unsigned short port = X_TCP_PORT + display; - return _xcb_open_tcp(host, protocol, port); - } + /* display specifies TCP */ + unsigned short port = X_TCP_PORT + display; + return _xcb_open_tcp(host, protocol, port); } #ifndef _WIN32 @@ -279,9 +277,6 @@ static int _xcb_open_tcp(const char *host, char *protocol, const unsigned short host = "localhost"; memset(&hints, 0, sizeof(hints)); -#ifdef AI_ADDRCONFIG - hints.ai_flags |= AI_ADDRCONFIG; -#endif #ifdef AI_NUMERICSERV hints.ai_flags |= AI_NUMERICSERV; #endif