summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-event/sd-event.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-08-18 18:12:55 +0200
committerLennart Poettering <lennart@poettering.net>2014-08-18 18:12:55 +0200
commit630a4d9ea7298fb4a494662cbb4871069143ff56 (patch)
tree01059a8c749b0dabfd98b6f40a587e0fcdf8bfae /src/libsystemd/sd-event/sd-event.c
parent283868e1dcd8ea7475850d9c6e7d4722c473dd50 (diff)
parente0fbf1fcffe014d5af6767b29f9108c2f2444888 (diff)
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src/libsystemd/sd-event/sd-event.c')
-rw-r--r--src/libsystemd/sd-event/sd-event.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c
index 1e3afaeacc..7917ab934a 100644
--- a/src/libsystemd/sd-event/sd-event.c
+++ b/src/libsystemd/sd-event/sd-event.c
@@ -779,7 +779,7 @@ _public_ int sd_event_add_io(
r = source_io_register(s, s->enabled, events);
if (r < 0) {
source_free(s);
- return -errno;
+ return r;
}
if (ret)
@@ -894,6 +894,8 @@ _public_ int sd_event_add_time(
s->userdata = userdata;
s->enabled = SD_EVENT_ONESHOT;
+ d->needs_rearm = true;
+
r = prioq_put(d->earliest, s, &s->time.earliest_index);
if (r < 0)
goto fail;
@@ -902,8 +904,6 @@ _public_ int sd_event_add_time(
if (r < 0)
goto fail;
- d->needs_rearm = true;
-
if (ret)
*ret = s;
@@ -1060,7 +1060,7 @@ _public_ int sd_event_add_child(
r = event_update_signal_fd(e);
if (r < 0) {
source_free(s);
- return -errno;
+ return r;
}
}
@@ -1872,6 +1872,7 @@ static int process_timer(
prioq_reshuffle(d->earliest, s, &s->time.earliest_index);
prioq_reshuffle(d->latest, s, &s->time.latest_index);
+ d->needs_rearm = true;
}
return 0;