From 5a13b093b50eebfaa44bafccfe0ffb4c9f12eac7 Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Wed, 21 Oct 2015 15:39:16 -0400 Subject: [PATCH] ecore-wl2: Connect to proper name during ecore_wl2_display_connect Signed-off-by: Chris Michael --- src/lib/ecore_wl2/ecore_wl2_display.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/lib/ecore_wl2/ecore_wl2_display.c b/src/lib/ecore_wl2/ecore_wl2_display.c index 470405951f..9d90e1f899 100644 --- a/src/lib/ecore_wl2/ecore_wl2_display.c +++ b/src/lib/ecore_wl2/ecore_wl2_display.c @@ -425,6 +425,12 @@ ecore_wl2_display_connect(const char *name) if (ewd) goto found; } + if ((!name) && (!n)) + { + ERR("No Wayland Display Running"); + goto name_err; + } + /* allocate space for display structure */ ewd = calloc(1, sizeof(Ecore_Wl2_Display)); if (!ewd) return NULL; @@ -439,10 +445,10 @@ ecore_wl2_display_connect(const char *name) ewd->globals = eina_hash_int32_new(_cb_globals_hash_del); /* try to connect to wayland display with this name */ - ewd->wl.display = wl_display_connect(name); + ewd->wl.display = wl_display_connect(ewd->name); if (!ewd->wl.display) { - ERR("Could not connect to display %s: %m", name); + ERR("Could not connect to display %s: %m", ewd->name); goto connect_err; } @@ -484,6 +490,10 @@ connect_err: free(ewd); return NULL; +name_err: + eina_hash_free(_client_displays); + return NULL; + found: ewd->refs++; return ewd;