ecore - ecore_pipe_wait timeout broken as it never adjusts while waiting
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Tue, 5 May 2015 10:28:14 +0000 (19:28 +0900)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Fri, 8 May 2015 05:13:17 +0000 (14:13 +0900)
if select gets interrupted it just waits again from the start because
it uses loop time not "now" time. this is wrong and makes timeout
waits possibly hang if enough things interrupt select without reading
data. this fixes that.

@fix

src/lib/ecore/ecore_pipe.c

index 23b80d1..823f07d 100644 (file)
@@ -438,7 +438,7 @@ _ecore_pipe_wait(Ecore_Pipe *p,
    FD_SET(p->fd_read, &rset);
 
    if (wait >= 0.0)
-     end = ecore_loop_time_get() + wait;
+     end = ecore_time_get() + wait;
    timeout = wait;
 
    while (message_count > 0 && (timeout > 0.0 || wait <= 0.0))
@@ -493,7 +493,7 @@ _ecore_pipe_wait(Ecore_Pipe *p,
           }
 
         if (wait >= 0.0)
-          timeout = end - ecore_loop_time_get();
+          timeout = end - ecore_time_get();
      }
 
    return total;