summaryrefslogtreecommitdiff
path: root/src/lib/eina
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 /src/lib/eina
parent7a02c2ac38534fbb715c230b6d55b1edd7494dc1 (diff)
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 T7107 Depends on D6747 Reviewers: zmike, stefan_schmidt, #committers Reviewed By: zmike, #committers Subscribers: #reviewers, cedric, #committers, zmike Tags: #efl Maniphest Tasks: T7107 Differential Revision: https://phab.enlightenment.org/D6748
Diffstat (limited to 'src/lib/eina')
-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 @@
70#include "eina_hash.h" 70#include "eina_hash.h"
71#include "eina_stringshare.h" 71#include "eina_stringshare.h"
72#include "eina_debug_private.h" 72#include "eina_debug_private.h"
73#include "eina_vpath.h"
74#include "eina_internal.h"
73 75
74#ifdef EINA_HAVE_PTHREAD_SETNAME 76#ifdef EINA_HAVE_PTHREAD_SETNAME
75# ifndef __linux__ 77# ifndef __linux__
@@ -442,16 +444,6 @@ _opcodes_unregister_all(Eina_Debug_Session *session)
442 } 444 }
443} 445}
444 446
445static const char *
446_socket_home_get()
447{
448 // get possible debug daemon socket directory base
449 const char *dir = getenv("XDG_RUNTIME_DIR");
450 if (!dir) dir = eina_environment_home_get();
451 if (!dir) dir = eina_environment_tmp_get();
452 return dir;
453}
454
455#define LENGTH_OF_SOCKADDR_UN(s) \ 447#define LENGTH_OF_SOCKADDR_UN(s) \
456 (strlen((s)->sun_path) + (size_t)(((struct sockaddr_un *)NULL)->sun_path)) 448 (strlen((s)->sun_path) + (size_t)(((struct sockaddr_un *)NULL)->sun_path))
457#endif 449#endif
@@ -514,7 +506,7 @@ eina_debug_local_connect(Eina_Bool is_master)
514 // ~/.ecore/efl_debug/0 506 // ~/.ecore/efl_debug/0
515 // or maybe 507 // or maybe
516 // /var/run/UID/.ecore/efl_debug/0 508 // /var/run/UID/.ecore/efl_debug/0
517 snprintf(buf, sizeof(buf), "%s/%s/%s/%i", _socket_home_get(), 509 eina_vpath_resolve_snprintf(buf, sizeof(buf), "(:usr.run:)/%s/%s/%i",
518 LOCAL_SERVER_PATH, LOCAL_SERVER_NAME, LOCAL_SERVER_PORT); 510 LOCAL_SERVER_PATH, LOCAL_SERVER_NAME, LOCAL_SERVER_PORT);
519 // create the socket 511 // create the socket
520 fd = socket(AF_UNIX, SOCK_STREAM, 0); 512 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[] = {
173 S(module), 173 S(module),
174 S(mempool), 174 S(mempool),
175 S(list), 175 S(list),
176 S(stringshare),
177 S(vpath),
176 S(debug), 178 S(debug),
177 S(evlog), 179 S(evlog),
178 S(stringshare),
179 S(error), 180 S(error),
180 S(safety_checks), 181 S(safety_checks),
181 S(magic_string), 182 S(magic_string),
@@ -205,7 +206,6 @@ static const struct eina_desc_setup _eina_desc_setup[] = {
205 S(safepointer), 206 S(safepointer),
206 S(slstr), 207 S(slstr),
207 S(promise), 208 S(promise),
208 S(vpath),
209#undef S 209#undef S
210}; 210};
211static const size_t _eina_desc_setup_len = sizeof(_eina_desc_setup) / 211static const size_t _eina_desc_setup_len = sizeof(_eina_desc_setup) /