Setting a child-source state to anything but SD_EVENT_OFF currently does
nothing. The condition logic is flawed. Move the state update *below* the
test for the previous state.
Fixes a crash if you call:
sd_event_source_set_enabled(source, SD_EVENT_ON);
sd_event_source_unref(source);
on a child-source in its own callback.
break;
case SOURCE_CHILD:
- s->enabled = m;
-
if (s->enabled == SD_EVENT_OFF) {
s->event->n_enabled_child_sources++;
event_update_signal_fd(s->event);
}
}
+
+ s->enabled = m;
break;
case SOURCE_EXIT: