aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ecore_con
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2015-05-14 18:40:47 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-05-14 18:41:48 +0200
commit94eaaf889b92d3dd3897488ba141108b4369268f (patch)
treebbf7c0ed02a0a54b41f303a8ae8e781a93b074bc /src/lib/ecore_con
parentethumb: use portable environment lookup. (diff)
downloadefl-94eaaf889b92d3dd3897488ba141108b4369268f.tar.gz
ecore_con: use portable environment lookup.
Diffstat (limited to 'src/lib/ecore_con')
-rw-r--r--src/lib/ecore_con/ecore_con_local.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/src/lib/ecore_con/ecore_con_local.c b/src/lib/ecore_con/ecore_con_local.c
index dc9a78e2bf..2c5ca87e5e 100644
--- a/src/lib/ecore_con/ecore_con_local.c
+++ b/src/lib/ecore_con/ecore_con_local.c
@@ -37,20 +37,11 @@
static int _ecore_con_local_init_count = 0;
-static inline const char *_ecore_con_get_tmpdir()
-{
- const char *tmpdir = "/tmp";
- const char *dir = getenv("TMPDIR");
-
- if (!dir) return tmpdir;
- return dir;
-}
-
static const char *_ecore_con_local_path_get()
{
const char *homedir = getenv("XDG_RUNTIME_DIR");
- if (!homedir) homedir = getenv("HOME");
- if (!homedir) homedir = _ecore_con_get_tmpdir();
+ if (!homedir) homedir = eina_environment_home_get();
+ if (!homedir) homedir = eina_environment_tmp_get();
return homedir;
}
@@ -124,7 +115,7 @@ ecore_con_local_connect(Ecore_Con_Server *obj,
}
else
{
- homedir = _ecore_con_get_tmpdir();
+ homedir = eina_environment_tmp_get();
snprintf(buf, sizeof(buf), "%s/.ecore_service|%s",
homedir, svr->name);
}
@@ -135,7 +126,7 @@ ecore_con_local_connect(Ecore_Con_Server *obj,
snprintf(buf, sizeof(buf), "%s|%i", svr->name, svr->port);
else
{
- homedir = _ecore_con_get_tmpdir();
+ homedir = eina_environment_tmp_get();
snprintf(buf, sizeof(buf), "%s/.ecore_service|%s|%i",
homedir, svr->name, svr->port);
}
@@ -285,7 +276,7 @@ ecore_con_local_listen(
}
else
{
- homedir = _ecore_con_get_tmpdir();
+ homedir = eina_environment_tmp_get();
snprintf(buf, sizeof(buf), "%s/.ecore_service|%s",
homedir, svr->name);
}
@@ -296,7 +287,7 @@ ecore_con_local_listen(
snprintf(buf, sizeof(buf), "%s|%i", svr->name, svr->port);
else
{
- homedir = _ecore_con_get_tmpdir();
+ homedir = eina_environment_tmp_get();
snprintf(buf, sizeof(buf), "%s/.ecore_service|%s|%i",
homedir, svr->name, svr->port);
}