forked from enlightenment/edi
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.
This commit is contained in:
parent
bcd9c85741
commit
e528a3c8bc
|
@ -16,6 +16,8 @@ typedef struct _Edi_Exe_Args {
|
||||||
Ecore_Event_Handler *handler;
|
Ecore_Event_Handler *handler;
|
||||||
} Edi_Exe_Args;
|
} Edi_Exe_Args;
|
||||||
|
|
||||||
|
static Eina_Bool _edi_exe_in_progress = EINA_FALSE;
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_edi_exe_notify_data_cb(void *data, int type EINA_UNUSED, void *event EINA_UNUSED)
|
_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);
|
free(args);
|
||||||
|
|
||||||
|
_edi_exe_in_progress = EINA_FALSE;
|
||||||
|
|
||||||
return ECORE_CALLBACK_DONE;
|
return ECORE_CALLBACK_DONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,6 +93,11 @@ edi_exe_notify(const char *name, const char *command)
|
||||||
{
|
{
|
||||||
Edi_Exe_Args *args;
|
Edi_Exe_Args *args;
|
||||||
|
|
||||||
|
if (_edi_exe_in_progress)
|
||||||
|
return;
|
||||||
|
|
||||||
|
_edi_exe_in_progress = EINA_TRUE;
|
||||||
|
|
||||||
ecore_exe_pipe_run(command,
|
ecore_exe_pipe_run(command,
|
||||||
ECORE_EXE_PIPE_READ_LINE_BUFFERED | ECORE_EXE_PIPE_READ |
|
ECORE_EXE_PIPE_READ_LINE_BUFFERED | ECORE_EXE_PIPE_READ |
|
||||||
ECORE_EXE_PIPE_ERROR_LINE_BUFFERED | ECORE_EXE_PIPE_ERROR |
|
ECORE_EXE_PIPE_ERROR_LINE_BUFFERED | ECORE_EXE_PIPE_ERROR |
|
||||||
|
|
Loading…
Reference in New Issue