if (ev->pipe_fde) {
talloc_free(ev->pipe_fde);
+ close(ev->pipe_fds[0]);
+ close(ev->pipe_fds[1]);
ev->pipe_fde = NULL;
}
sn = se->next;
se->event_ctx = NULL;
DLIST_REMOVE(ev->signal_events, se);
+ /*
+ * This is important, Otherwise signals
+ * are handled twice in child. eg, SIGHUP.
+ * one added in parent, and another one in
+ * the child. -- BoYang
+ */
+ tevent_cleanup_pending_signal_handlers(se);
}
return 0;
errno = ELOOP;
return -1;
}
+ }
+ if (ev->nesting.level > 0) {
if (ev->nesting.hook_fn) {
int ret2;
ret2 = ev->nesting.hook_fn(ev,
ret = ev->ops->loop_once(ev, location);
- if (ev->nesting.level > 1) {
+ if (ev->nesting.level > 0) {
if (ev->nesting.hook_fn) {
int ret2;
ret2 = ev->nesting.hook_fn(ev,
errno = ELOOP;
return -1;
}
+ }
+ if (ev->nesting.level > 0) {
if (ev->nesting.hook_fn) {
int ret2;
ret2 = ev->nesting.hook_fn(ev,
}
}
- if (ev->nesting.level > 1) {
+ if (ev->nesting.level > 0) {
if (ev->nesting.hook_fn) {
int ret2;
ret2 = ev->nesting.hook_fn(ev,
*/
int _tevent_loop_wait(struct tevent_context *ev, const char *location)
{
- int ret;
- ev->nesting.level++;
- ret = ev->ops->loop_wait(ev, location);
- ev->nesting.level--;
- return ret;
+ return ev->ops->loop_wait(ev, location);
}