discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=77ce62e1d2da448eea32aaeb753dcba7a7808f57

commit 77ce62e1d2da448eea32aaeb753dcba7a7808f57
Author: Marcel Hollerbach <m...@marcel-hollerbach.de>
Date:   Mon Aug 20 12:58:23 2018 -0400

    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 D6744
    
    Reviewers: zmike, stefan_schmidt
    
    Reviewed By: zmike
    
    Subscribers: #reviewers, cedric, #committers, zmike
    
    Tags: #efl
    
    Differential Revision: https://phab.enlightenment.org/D6745
---
 src/bin/elementary/quicklaunch.c | 7 ++-----
 1 file 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)

-- 


Reply via email to