summaryrefslogtreecommitdiff
path: root/src/core/dbus-timer.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-02-01 21:27:33 +0100
committerLennart Poettering <lennart@poettering.net>2016-02-01 22:18:16 +0100
commitb93ea5d3681c15155f50a296802e4ab6f04e3cd1 (patch)
treebd93fe0f3cf027c45080cb5b53fc203f24e76cf8 /src/core/dbus-timer.c
parent99d4f5e5c0d2532159542519e683f976f881f0f5 (diff)
core: fix handling of AccuracyUSec and RandomDelayUSec bus properties
Clear up some confusion regarding the USec and Sec suffixes we use. In configuration files we usually use the Sec suffix, to indicate the implied time unit if none is specified. The respective bus properties however use the USec property, since they expose 64bit unsigned integers containing time in µs. Before this patch timer units exposed a bus property AccuracyUSec (which hence is the correct name) but when parsing transient property data would look for AccuracySec instead (which is incorrect). This patch ensures we look for AccuracySec correctly, but keeps the code for AccuracyUSec in place for compatibility, but adds a warning to ensure that apps are updated to use the right property.
Diffstat (limited to 'src/core/dbus-timer.c')
-rw-r--r--src/core/dbus-timer.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/dbus-timer.c b/src/core/dbus-timer.c
index ec301df6d7..212f9e1d8d 100644
--- a/src/core/dbus-timer.c
+++ b/src/core/dbus-timer.c
@@ -267,10 +267,12 @@ static int bus_timer_set_transient_property(
return 1;
- } else if (streq(name, "AccuracySec")) {
-
+ } else if (STR_IN_SET(name, "AccuracyUSec", "AccuracySec")) {
usec_t u = 0;
+ if (streq(name, "AccuracySec"))
+ log_notice("Client is using obsolete AccuracySec= transient property, please use AccuracyUSec= instead.");
+
r = sd_bus_message_read(message, "t", &u);
if (r < 0)
return r;