aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2018-08-20 12:58:35 -0400
committerMike Blumenkrantz <zmike@samsung.com>2018-08-20 12:58:35 -0400
commitf6579e47ab27782f5f97bab8b8f26d86d2ca4ff9 (patch)
tree4d8ac36eb0a6759565926639380af7c7cf201c79
parentquicklaunch: use xdg abstraction instead of direct env var (diff)
downloadefl-f6579e47ab27782f5f97bab8b8f26d86d2ca4ff9.tar.gz
ecore_con: migrate to eina_vpath
Summary: the logic here was against the xdg standard, thus we migrate to eina_vpath which uses the correct xdg standard Depends on https://phab.enlightenment.org/D6745 Reviewers: zmike, stefan_schmidt, #committers Reviewed By: zmike, #committers Subscribers: #reviewers, cedric, #committers, zmike Tags: #efl Differential Revision: https://phab.enlightenment.org/D6746
-rw-r--r--src/lib/ecore_con/ecore_con_local.c37
1 files changed, 3 insertions, 34 deletions
diff --git a/src/lib/ecore_con/ecore_con_local.c b/src/lib/ecore_con/ecore_con_local.c
index 874fd7b2c7..b3568837b5 100644
--- a/src/lib/ecore_con/ecore_con_local.c
+++ b/src/lib/ecore_con/ecore_con_local.c
@@ -27,22 +27,6 @@
#include "Ecore_Con.h"
#include "ecore_con_private.h"
-#ifndef _WIN32
-static const char *
-_ecore_con_local_path_get(void)
-{
- static char *homedir = NULL;
- if (homedir) return homedir;
-
-#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
- if (getuid() == geteuid()) homedir = getenv("XDG_RUNTIME_DIR");
-#endif
- if (!homedir) homedir = (char *)eina_environment_home_get();
- if (!homedir) homedir = (char *)eina_environment_tmp_get();
- return homedir;
-}
-#endif
-
EAPI char *
ecore_con_local_path_new(Eina_Bool is_system, const char *name, int port)
{
@@ -84,26 +68,11 @@ ecore_con_local_path_new(Eina_Bool is_system, const char *name, int port)
if (!is_system)
{
-#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
- if (getuid() == geteuid())
-#endif
- homedir = _ecore_con_local_path_get();
-#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
- else
- {
- struct passwd *pw = getpwent();
-
- if ((!pw) || (!pw->pw_dir)) homedir = "/tmp";
- else homedir = pw->pw_dir;
- }
-#endif
-
if (port < 0)
- snprintf(buf, sizeof(buf), "%s/.ecore/%s",
- homedir, name);
+ eina_vpath_resolve_snprintf(buf, sizeof(buf), "(:usr.run:)/.ecore/%s", name);
else
- snprintf(buf, sizeof(buf), "%s/.ecore/%s/%i",
- homedir, name, port);
+ eina_vpath_resolve_snprintf(buf, sizeof(buf), "(:usr.run:)/.ecore/%s/%i", name, port);
+
return strdup(buf);
}
else