aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2018-08-20 12:58:23 -0400
committerMike Blumenkrantz <zmike@samsung.com>2018-08-20 12:58:23 -0400
commit77ce62e1d2da448eea32aaeb753dcba7a7808f57 (patch)
treeb4238790eadf10a71814b7b05f5cca952c642e95
parentmove efreet xdg envvars to eina (diff)
downloadefl-77ce62e1d2da448eea32aaeb753dcba7a7808f57.tar.gz
quicklaunch: use xdg abstraction instead of direct env var
Summary: there are defined ways what should happen in XDG_RUNTIME_DIR is not defined, eina_vpath is the abstraction for doing this. This ensures that the socket is created in the correct directory. Depends on https://phab.enlightenment.org/D6744 Reviewers: zmike, stefan_schmidt Reviewed By: zmike Subscribers: #reviewers, cedric, #committers, zmike Tags: #efl Differential Revision: https://phab.enlightenment.org/D6745
-rw-r--r--src/bin/elementary/quicklaunch.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/bin/elementary/quicklaunch.c b/src/bin/elementary/quicklaunch.c
index eb376ee216..d23287e32e 100644
--- a/src/bin/elementary/quicklaunch.c
+++ b/src/bin/elementary/quicklaunch.c
@@ -182,7 +182,6 @@ main(int argc, char **argv)
char buf[PATH_MAX];
struct sigaction action;
const char *domain;
- char *rundir;
int ret = 0;
if (!eina_init())
@@ -204,9 +203,7 @@ main(int argc, char **argv)
if (!domain) domain = getenv("DISPLAY");
if (!domain) domain = "unknown";
}
- rundir = getenv("XDG_RUNTIME_DIR");
- if (!rundir) rundir = "/tmp";
- snprintf(buf, sizeof(buf), "%s/elm-ql-%i", rundir, getuid());
+ eina_vpath_resolve_snprintf(buf, sizeof(buf), "(:usr.run:)/elm-ql-%i", getuid());
if (stat(buf, &st) < 0)
{
ret = mkdir(buf, S_IRUSR | S_IWUSR | S_IXUSR);
@@ -216,7 +213,7 @@ main(int argc, char **argv)
exit(-1);
}
}
- snprintf(buf, sizeof(buf), "%s/elm-ql-%i/%s", rundir, getuid(), domain);
+ eina_vpath_resolve_snprintf(buf, sizeof(buf), "(:usr.run:)/elm-ql-%i/%s", getuid(), domain);
unlink(buf);
sock = socket(AF_UNIX, SOCK_STREAM, 0);
if (sock < 0)