raster pushed a commit to branch master.

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

commit f3c01a9a6c157230d03156b221d690e003284e70
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Sat Aug 10 23:17:39 2019 +0100

    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
---
 src/lib/ecore/efl_thread.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/lib/ecore/efl_thread.c b/src/lib/ecore/efl_thread.c
index 9ae137ae31..a5bb07caef 100644
--- a/src/lib/ecore/efl_thread.c
+++ b/src/lib/ecore/efl_thread.c
@@ -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;

-- 


Reply via email to