forked from enlightenment/efl
efl thread - use pipe array names consistently to avoid err handling bug
in the case pipes fail to create we'll close the wrong ones... this fixes that. it also happens because i didn't use names consistently. now it does so it's easier to keep right. thanks coverity. fix CID 1396994
This commit is contained in:
parent
d0d883b1c9
commit
64b18d5152
|
@ -592,7 +592,7 @@ _efl_thread_efl_task_run(Eo *obj, Efl_Thread_Data *pd)
|
|||
// input/output pipes
|
||||
if (td->flags & EFL_TASK_FLAGS_USE_STDIN)
|
||||
{
|
||||
if (pipe(pipe_to_thread) != 0)
|
||||
if (pipe(pipe_from_thread) != 0)
|
||||
{
|
||||
ERR("Can't create to_thread pipe");
|
||||
free(thdat);
|
||||
|
@ -601,13 +601,13 @@ _efl_thread_efl_task_run(Eo *obj, Efl_Thread_Data *pd)
|
|||
}
|
||||
if (td->flags & EFL_TASK_FLAGS_USE_STDOUT)
|
||||
{
|
||||
if (pipe(pipe_from_thread) != 0)
|
||||
if (pipe(pipe_to_thread) != 0)
|
||||
{
|
||||
ERR("Can't create from_thread pipe");
|
||||
if (td->flags & EFL_TASK_FLAGS_USE_STDIN)
|
||||
{
|
||||
close(pipe_to_thread[0]);
|
||||
close(pipe_to_thread[1]);
|
||||
close(pipe_from_thread[0]);
|
||||
close(pipe_from_thread[1]);
|
||||
}
|
||||
free(thdat);
|
||||
return NULL;
|
||||
|
|
Loading…
Reference in New Issue