]> git.ipfire.org Git - thirdparty/systemd.git/commit
event: fix crash on child-source state modifications
authorDavid Herrmann <dh.herrmann@gmail.com>
Wed, 19 Feb 2014 12:24:38 +0000 (13:24 +0100)
committerDavid Herrmann <dh.herrmann@gmail.com>
Wed, 19 Feb 2014 12:24:38 +0000 (13:24 +0100)
commit7a0d4a3d16855bac2ce2f2973122dae1ed069dff
treeced4ec82ff895582c816f8d28663a0f1bc12cbee
parentb67f562c9cac44bd78b24f5aae78a1797c5d4182
event: fix crash on child-source state modifications

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.
src/libsystemd/sd-event/sd-event.c