aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2018-08-20 12:59:15 -0400
committerMike Blumenkrantz <zmike@samsung.com>2018-08-20 12:59:15 -0400
commitcf74462b766755b7b9944a5f5715d72164bc67d4 (patch)
tree56c107ce4cfc1cc1e8e96aae1a3f9e51ef02d0ab
parentefl_debugd: move to eina vpath (diff)
downloadefl-cf74462b766755b7b9944a5f5715d72164bc67d4.tar.gz
eina_debug: switch to vpath
Summary: eina debug was using the xdg runtime dir in a wrong manner. Since the directory should be only used by the user, and the directory should be be subject of any other usage. Additionally, apps tend to create files like: $XDG_RUNTIME_DIR/foo.bar which is probebly not what you want in $HOME. ref https://phab.enlightenment.org/T7107 Depends on https://phab.enlightenment.org/D6747 Reviewers: zmike, stefan_schmidt, #committers Reviewed By: zmike, #committers Subscribers: #reviewers, cedric, #committers, zmike Tags: #efl Maniphest Tasks: https://phab.enlightenment.org/T7107 Differential Revision: https://phab.enlightenment.org/D6748
-rw-r--r--src/lib/eina/eina_debug.c14
-rw-r--r--src/lib/eina/eina_main.c4
2 files changed, 5 insertions, 13 deletions
diff --git a/src/lib/eina/eina_debug.c b/src/lib/eina/eina_debug.c
index 4d70454d0a..4d003bf029 100644
--- a/src/lib/eina/eina_debug.c
+++ b/src/lib/eina/eina_debug.c
@@ -70,6 +70,8 @@
#include "eina_hash.h"
#include "eina_stringshare.h"
#include "eina_debug_private.h"
+#include "eina_vpath.h"
+#include "eina_internal.h"
#ifdef EINA_HAVE_PTHREAD_SETNAME
# ifndef __linux__
@@ -442,16 +444,6 @@ _opcodes_unregister_all(Eina_Debug_Session *session)
}
}
-static const char *
-_socket_home_get()
-{
- // get possible debug daemon socket directory base
- const char *dir = getenv("XDG_RUNTIME_DIR");
- if (!dir) dir = eina_environment_home_get();
- if (!dir) dir = eina_environment_tmp_get();
- return dir;
-}
-
#define LENGTH_OF_SOCKADDR_UN(s) \
(strlen((s)->sun_path) + (size_t)(((struct sockaddr_un *)NULL)->sun_path))
#endif
@@ -514,7 +506,7 @@ eina_debug_local_connect(Eina_Bool is_master)
// ~/.ecore/efl_debug/0
// or maybe
// /var/run/UID/.ecore/efl_debug/0
- snprintf(buf, sizeof(buf), "%s/%s/%s/%i", _socket_home_get(),
+ eina_vpath_resolve_snprintf(buf, sizeof(buf), "(:usr.run:)/%s/%s/%i",
LOCAL_SERVER_PATH, LOCAL_SERVER_NAME, LOCAL_SERVER_PORT);
// create the socket
fd = socket(AF_UNIX, SOCK_STREAM, 0);
diff --git a/src/lib/eina/eina_main.c b/src/lib/eina/eina_main.c
index b3790f14d7..024d1e3eaa 100644
--- a/src/lib/eina/eina_main.c
+++ b/src/lib/eina/eina_main.c
@@ -173,9 +173,10 @@ static const struct eina_desc_setup _eina_desc_setup[] = {
S(module),
S(mempool),
S(list),
+ S(stringshare),
+ S(vpath),
S(debug),
S(evlog),
- S(stringshare),
S(error),
S(safety_checks),
S(magic_string),
@@ -205,7 +206,6 @@ static const struct eina_desc_setup _eina_desc_setup[] = {
S(safepointer),
S(slstr),
S(promise),
- S(vpath),
#undef S
};
static const size_t _eina_desc_setup_len = sizeof(_eina_desc_setup) /