[systemd-commits] 2 commits - src/libsystemd-bus
David Herrmann
dvdhrm at kemper.freedesktop.org
Wed Nov 20 07:20:35 PST 2013
src/libsystemd-bus/bus-util.c | 2 +-
src/libsystemd-bus/sd-event.c | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
New commits:
commit 0cc1125ae10a216f2b27cb2828849ac1beb6a1b1
Author: David Herrmann <dh.herrmann at gmail.com>
Date: Wed Nov 20 07:54:24 2013 +0100
event: clear pending-state when re-arming timers
If a timer fires and is marked pending, but an application re-arms it
before it is dispatched, we now clear the pending state.
This fixes a bug where an application arms a timer, which fires and is
marked pending. But before it is dispatched, the application loses
interest in it and disables it. Now if the timer is re-armed and
re-enabled later, it will be immediately dispatched as it is still marked
pending.
This behavior is unexpected, so avoid it by clearing pending state when
re-arming timers. Note that applications have no way to clear pending
state themselves, so there's no current workaround.
diff --git a/src/libsystemd-bus/sd-event.c b/src/libsystemd-bus/sd-event.c
index 0996316..d01e82d 100644
--- a/src/libsystemd-bus/sd-event.c
+++ b/src/libsystemd-bus/sd-event.c
@@ -1241,6 +1241,7 @@ _public_ int sd_event_source_set_time(sd_event_source *s, uint64_t usec) {
return 0;
s->time.next = usec;
+ source_set_pending(s, false);
if (s->type == SOURCE_REALTIME) {
prioq_reshuffle(s->event->realtime_earliest, s, &s->time.earliest_index);
commit 6c1508b871965b2eba46d477e81a9c4e85b2bd00
Author: David Herrmann <dh.herrmann at gmail.com>
Date: Wed Nov 20 16:18:37 2013 +0100
bus: fix error-path in bus_map_all_properties()
We shouldn't return positive integers on errors. Fix the typo by removing
the negation.
diff --git a/src/libsystemd-bus/bus-util.c b/src/libsystemd-bus/bus-util.c
index 33bdf38..ed6fdc4 100644
--- a/src/libsystemd-bus/bus-util.c
+++ b/src/libsystemd-bus/bus-util.c
@@ -919,7 +919,7 @@ int bus_map_all_properties(sd_bus *bus,
} else {
r = sd_bus_message_skip(m, "v");
if (r < 0)
- return -r;
+ return r;
}
r = sd_bus_message_exit_container(m);
More information about the systemd-commits
mailing list