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
60f549c5fb
commit
f3c01a9a6c
|
@ -648,7 +648,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);
|
||||
|
@ -657,13 +657,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