discomfitor pushed a commit to branch enlightenment-0.19.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=35bba6b6c0f3afec9ddf8f6e53164ad9525027f7

commit 35bba6b6c0f3afec9ddf8f6e53164ad9525027f7
Author: Jean Guyomarc'h <jean.guyoma...@gmail.com>
Date:   Sat May 2 10:04:28 2015 -0400

    e_ipc: fix creation of IPC server when $DISPLAY is a path
    
    Summary:
    Some implementations of the X server (e.g. Xquartz) define their $DISPLAY
    as a path. Since ecore_ipc_server_add() does not create non-existant
    directories, and since it may not worth to hide the socket in a complex
    path, this patch aims at reducing the $DISPLAY by only keeping its basename.
    
    Reviewers: zmike
    
    Subscribers: cedric
    
    Differential Revision: https://phab.enlightenment.org/D2465
---
 src/bin/e_ipc.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/bin/e_ipc.c b/src/bin/e_ipc.c
index 5af2f69..be97696 100644
--- a/src/bin/e_ipc.c
+++ b/src/bin/e_ipc.c
@@ -17,7 +17,7 @@ EINTERN int
 e_ipc_init(void)
 {
    char buf[4096], buf2[128], buf3[4096];
-   char *tmp, *user, *disp, *base;
+   char *tmp, *user, *disp, *disp2, *base;
    int pid, trynum = 0, id1 = 0;
    struct stat st;
 
@@ -73,6 +73,12 @@ e_ipc_init(void)
 
    disp = getenv("DISPLAY");
    if (!disp) disp = ":0";
+   else
+     {
+        /* $DISPLAY may be a path (e.g. Xquartz), keep the basename. */
+        disp2 = strrchr(disp, '/');
+        if (disp2) disp = disp2 + 1;
+     }
 
    e_util_env_set("E_IPC_SOCKET", "");
 

-- 


Reply via email to