From: Cedric BAIL Date: Mon, 12 Oct 2015 21:00:01 +0000 (-0700) Subject: ecore_con: be more defensive while using environment variable provided by the system. X-Git-Tag: v1.16.0-beta2~94 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ec909b4d6a1bf50e2f4e4be1096275ee14f6c0e4;p=platform%2Fupstream%2Fefl.git ecore_con: be more defensive while using environment variable provided by the system. This fix a crash during make check for system where one of those string where not defined. --- diff --git a/src/tests/ecore_con/ecore_con_test_ecore_con.c b/src/tests/ecore_con/ecore_con_test_ecore_con.c index 67f3672..6618221 100644 --- a/src/tests/ecore_con/ecore_con_test_ecore_con.c +++ b/src/tests/ecore_con/ecore_con_test_ecore_con.c @@ -362,9 +362,9 @@ START_TEST(ecore_test_ecore_con_local_user_none) unsetenv("HOME"); unsetenv("TMPDIR"); _ecore_con_server_client_tests(ECORE_CON_LOCAL_USER, "test_sock", EINA_FALSE, 12345); - setenv("TMPDIR", tmp, 1); - setenv("HOME", homedir, 1); - setenv("XDG_RUNTIME_DIR", xdg_runtime_dir, 1); + if (tmp) setenv("TMPDIR", tmp, 1); + if (homedir) setenv("HOME", homedir, 1); + if (xdg_runtime_dir) setenv("XDG_RUNTIME_DIR", xdg_runtime_dir, 1); } END_TEST