diff options
Diffstat (limited to 'src/lib/ecore_con')
-rw-r--r-- | src/lib/ecore_con/ecore_con_local.c | 37 |
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 @@ | |||
27 | #include "Ecore_Con.h" | 27 | #include "Ecore_Con.h" |
28 | #include "ecore_con_private.h" | 28 | #include "ecore_con_private.h" |
29 | 29 | ||
30 | #ifndef _WIN32 | ||
31 | static const char * | ||
32 | _ecore_con_local_path_get(void) | ||
33 | { | ||
34 | static char *homedir = NULL; | ||
35 | if (homedir) return homedir; | ||
36 | |||
37 | #if defined(HAVE_GETUID) && defined(HAVE_GETEUID) | ||
38 | if (getuid() == geteuid()) homedir = getenv("XDG_RUNTIME_DIR"); | ||
39 | #endif | ||
40 | if (!homedir) homedir = (char *)eina_environment_home_get(); | ||
41 | if (!homedir) homedir = (char *)eina_environment_tmp_get(); | ||
42 | return homedir; | ||
43 | } | ||
44 | #endif | ||
45 | |||
46 | EAPI char * | 30 | EAPI char * |
47 | ecore_con_local_path_new(Eina_Bool is_system, const char *name, int port) | 31 | ecore_con_local_path_new(Eina_Bool is_system, const char *name, int port) |
48 | { | 32 | { |
@@ -84,26 +68,11 @@ ecore_con_local_path_new(Eina_Bool is_system, const char *name, int port) | |||
84 | 68 | ||
85 | if (!is_system) | 69 | if (!is_system) |
86 | { | 70 | { |
87 | #if defined(HAVE_GETUID) && defined(HAVE_GETEUID) | ||
88 | if (getuid() == geteuid()) | ||
89 | #endif | ||
90 | homedir = _ecore_con_local_path_get(); | ||
91 | #if defined(HAVE_GETUID) && defined(HAVE_GETEUID) | ||
92 | else | ||
93 | { | ||
94 | struct passwd *pw = getpwent(); | ||
95 | |||
96 | if ((!pw) || (!pw->pw_dir)) homedir = "/tmp"; | ||
97 | else homedir = pw->pw_dir; | ||
98 | } | ||
99 | #endif | ||
100 | |||
101 | if (port < 0) | 71 | if (port < 0) |
102 | snprintf(buf, sizeof(buf), "%s/.ecore/%s", | 72 | eina_vpath_resolve_snprintf(buf, sizeof(buf), "(:usr.run:)/.ecore/%s", name); |
103 | homedir, name); | ||
104 | else | 73 | else |
105 | snprintf(buf, sizeof(buf), "%s/.ecore/%s/%i", | 74 | eina_vpath_resolve_snprintf(buf, sizeof(buf), "(:usr.run:)/.ecore/%s/%i", name, port); |
106 | homedir, name, port); | 75 | |
107 | return strdup(buf); | 76 | return strdup(buf); |
108 | } | 77 | } |
109 | else | 78 | else |