[PATCH 1/4] ephyr: xcb_connect returns an error, not NULL

Peter Hutterer peter.hutterer at who-t.net
Tue Oct 29 05:37:35 CET 2013


Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 hw/kdrive/ephyr/hostx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c
index 5fa33b9..58b6fd8 100644
--- a/hw/kdrive/ephyr/hostx.c
+++ b/hw/kdrive/ephyr/hostx.c
@@ -304,8 +304,8 @@ hostx_init(void)
         | XCB_EVENT_MASK_STRUCTURE_NOTIFY;
 
     EPHYR_DBG("mark");
-
-    if ((HostX.conn = xcb_connect(NULL, &HostX.screen)) == NULL) {
+    HostX.conn = xcb_connect(NULL, &HostX.screen);
+    if (xcb_connection_has_error(HostX.conn)) {
         fprintf(stderr, "\nXephyr cannot open host display. Is DISPLAY set?\n");
         exit(1);
     }
-- 
1.8.3.1



More information about the xorg-devel mailing list