From 8c2f2486634084c145c441a5b929a14bcef3be4f Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Wed, 18 Feb 2009 00:29:07 +0000 Subject: [PATCH] handle errors and use eina error print. SVN revision: 39066 --- src/lib/elm_main.c | 6 +++++- src/lib/elm_win.c | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lib/elm_main.c b/src/lib/elm_main.c index 2556704..a142f5c 100644 --- a/src/lib/elm_main.c +++ b/src/lib/elm_main.c @@ -214,7 +214,11 @@ elm_init(int argc, char **argv) #ifdef HAVE_ELEMENTARY_X int val = 1000; - ecore_x_init(NULL); + if (!ecore_x_init(NULL)) + { + EINA_ERROR_PERR("elementary: ERROR. Cannot connect to X11 display. check $DISPLAY variable\n"); + exit(1); + } if (!ecore_x_screen_is_composited(0)) _elm_config->compositing = 0; _elm_atom_enlightenment_scale = ecore_x_atom_get("ENLIGHTENMENT_SCALE"); diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c index 905c0fa..76c124b 100644 --- a/src/lib/elm_win.c +++ b/src/lib/elm_win.c @@ -281,7 +281,7 @@ elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type) } if (!win->ee) { - printf("ELEMENTARY: Error. Cannot create window.\n"); + EINA_ERROR_PERR("elementary: ERROR. Cannot create window.\n"); free(win); return NULL; } -- 2.7.4