summaryrefslogtreecommitdiff
path: root/src/eloop.c
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@googlemail.com>2012-03-23 17:58:19 +0100
committerDavid Herrmann <dh.herrmann@googlemail.com>2012-03-23 17:58:19 +0100
commit5f1f1710f928abaf8edd2f037b3b9035207537ae (patch)
tree0079f798de5945844e4a0997792c2eeaf9f4416d /src/eloop.c
parent42631efa2ce78cd8278d6f47b55cb8bee33a4939 (diff)
eloop: correctly set ->exit
When exiting a child eloop we should forward the exit to the parent. Also, we should reset ->exit on ev_eloop_run() otherwise we cannot run multiple times. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Diffstat (limited to 'src/eloop.c')
-rw-r--r--src/eloop.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/eloop.c b/src/eloop.c
index 55a95d3..ad53fea 100644
--- a/src/eloop.c
+++ b/src/eloop.c
@@ -820,6 +820,7 @@ int ev_eloop_run(struct ev_eloop *loop, int timeout)
if (!loop)
return -EINVAL;
+ loop->exit = false;
log_debug("run for %d msecs", timeout);
gettimeofday(&start, NULL);
@@ -857,4 +858,6 @@ void ev_eloop_exit(struct ev_eloop *loop)
log_debug("exiting %p", loop);
loop->exit = true;
+ if (loop->fd->loop)
+ ev_eloop_exit(loop->fd->loop);
}