summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-02-01 21:28:24 +0100
committerLennart Poettering <lennart@poettering.net>2016-02-01 22:18:16 +0100
commit5c1f0be1efd2bed25a8759ae0f9927e82afc086b (patch)
tree62ff4a13e65d94f5e7b79391bd21f7e014c3ca89 /src/core
parentb93ea5d3681c15155f50a296802e4ab6f04e3cd1 (diff)
core: when saving timer unit time values, store them in raw µs
Let's simplify things a bit, and make sure we don't lose accuracy.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/dbus-timer.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/core/dbus-timer.c b/src/core/dbus-timer.c
index 212f9e1d8d..321ed5da37 100644
--- a/src/core/dbus-timer.c
+++ b/src/core/dbus-timer.c
@@ -278,10 +278,8 @@ static int bus_timer_set_transient_property(
return r;
if (mode != UNIT_CHECK) {
- char time[FORMAT_TIMESPAN_MAX];
-
t->accuracy_usec = u;
- unit_write_drop_in_private_format(UNIT(t), mode, name, "%s=%s\n", name, format_timespan(time, sizeof(time), u, USEC_PER_MSEC));
+ unit_write_drop_in_private_format(UNIT(t), mode, name, "AccuracySec=" USEC_FMT "us\n", u);
}
return 1;
@@ -294,10 +292,8 @@ static int bus_timer_set_transient_property(
return r;
if (mode != UNIT_CHECK) {
- char time[FORMAT_TIMESPAN_MAX];
-
t->random_usec = u;
- unit_write_drop_in_private_format(UNIT(t), mode, name, "RandomizedDelaySec=%s\n", format_timespan(time, sizeof(time), u, USEC_PER_MSEC));
+ unit_write_drop_in_private_format(UNIT(t), mode, name, "RandomizedDelaySec=" USEC_FMT "us\n", u);
}
return 1;