From f543cb8fbb3d9213cb03396f4252ab9821319993 Mon Sep 17 00:00:00 2001 From: Ben Byer Date: Fri, 30 Nov 2007 11:18:46 -0800 Subject: [PATCH] properly implemented xcb check for stale sockets --- hw/darwin/apple/bundle-main.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/hw/darwin/apple/bundle-main.c b/hw/darwin/apple/bundle-main.c index 34cbcbab5..d46e7b2e8 100644 --- a/hw/darwin/apple/bundle-main.c +++ b/hw/darwin/apple/bundle-main.c @@ -614,20 +614,9 @@ display_exists_p (int number) if (access (buf, F_OK) != 0) return FALSE; - /* This is a private function that we shouldn't really be calling, - but it's the best way to see if the server exists (without - needing to hold the necessary authentication to use it) */ - sprintf (buf, ":%d", number); - /* conn = _X11TransConnectDisplay (buf, &fullname, &idisplay, &iscreen, - &conn_auth_name, &conn_auth_namelen, - &conn_auth_data, &conn_auth_datalen); */ - conn = xcb_connect(buf, NULL); - - if (conn == NULL) - return FALSE; + if (xcb_connection_has_error(conn)) return FALSE; - // _XDisconnectDisplay (conn); xcb_disconnect(conn); return TRUE; }