raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=9fd9a3b120fe9bef32af1fcc0742a9f875f484d8

commit 9fd9a3b120fe9bef32af1fcc0742a9f875f484d8
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Fri Apr 10 01:15:30 2020 +0200

    efreetd - ensure on bsd where connects succed despite daemon being gone
    
    just get it to work... getting unamused with this.
---
 src/lib/efreet/efreet_cache.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/lib/efreet/efreet_cache.c b/src/lib/efreet/efreet_cache.c
index a34ffd405d..f859c630f0 100644
--- a/src/lib/efreet/efreet_cache.c
+++ b/src/lib/efreet/efreet_cache.c
@@ -101,6 +101,7 @@ static void *hash_array_string_add(void *hash, const char 
*key, void *data);
 
 static Eina_Bool disable_cache;
 static Eina_Bool run_in_tree;
+static int relaunch_try = 0;
 
 EAPI int EFREET_EVENT_ICON_CACHE_UPDATE = 0;
 EAPI int EFREET_EVENT_DESKTOP_CACHE_UPDATE = 0;
@@ -120,8 +121,16 @@ _ipc_launch(void)
    int tries = 1000; // 1000 * 10ms == 10sec
    const char *s;
 
-   ipc = ecore_ipc_server_connect(ECORE_IPC_LOCAL_USER, "efreetd", 0, NULL);
-   if (ipc) return;
+   if (relaunch_try == 0)
+     {
+        ipc = ecore_ipc_server_connect(ECORE_IPC_LOCAL_USER, "efreetd", 0, 
NULL);
+        if (ipc)
+          {
+             relaunch_try++;
+             return;
+          }
+     }
+   relaunch_try--;
    s = getenv("EFREETD_CONNECT_TRIES");
    if (s)
      {
@@ -153,6 +162,7 @@ static Eina_Bool
 _cb_server_add(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
 {
    IPC_HEAD(Add);
+   relaunch_try--;
    return ECORE_CALLBACK_DONE;
 }
 

-- 


Reply via email to