netstar pushed a commit to branch master.

http://git.enlightenment.org/tools/edi.git/commit/?id=e528a3c8bc622ee884605f8bfcb4882f194a50b8

commit e528a3c8bc622ee884605f8bfcb4882f194a50b8
Author: Al Poole <[email protected]>
Date:   Tue Sep 19 20:16:32 2017 +0100

    build: fix race-condition.
    
    Use a global variable to keep track of builds. Both
    edi_exe_notify/handle could and should be done
    better. For now this stops an issue.
---
 src/lib/edi_exe.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/lib/edi_exe.c b/src/lib/edi_exe.c
index 48d3ce9..4cdd199 100644
--- a/src/lib/edi_exe.c
+++ b/src/lib/edi_exe.c
@@ -16,6 +16,8 @@ typedef struct _Edi_Exe_Args {
    Ecore_Event_Handler *handler;
 } Edi_Exe_Args;
 
+static Eina_Bool _edi_exe_in_progress = EINA_FALSE;
+
 static Eina_Bool
 _edi_exe_notify_data_cb(void *data, int type EINA_UNUSED, void *event 
EINA_UNUSED)
 {
@@ -81,6 +83,8 @@ _edi_exe_event_done_cb(void *data EINA_UNUSED, int type 
EINA_UNUSED, void *event
 
   free(args);
 
+  _edi_exe_in_progress = EINA_FALSE;
+
   return ECORE_CALLBACK_DONE;
 }
 
@@ -89,6 +93,11 @@ edi_exe_notify(const char *name, const char *command)
 {
    Edi_Exe_Args *args;
 
+   if (_edi_exe_in_progress)
+     return;
+
+   _edi_exe_in_progress = EINA_TRUE;
+
    ecore_exe_pipe_run(command,
                       ECORE_EXE_PIPE_READ_LINE_BUFFERED | ECORE_EXE_PIPE_READ |
                       ECORE_EXE_PIPE_ERROR_LINE_BUFFERED | 
ECORE_EXE_PIPE_ERROR |

-- 


Reply via email to