From 5c1f0be1efd2bed25a8759ae0f9927e82afc086b Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 1 Feb 2016 21:28:24 +0100 Subject: [PATCH] =?utf8?q?core:=20when=20saving=20timer=20unit=20time=20va?= =?utf8?q?lues,=20store=20them=20in=20raw=20=C2=B5s?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Let's simplify things a bit, and make sure we don't lose accuracy. --- src/core/dbus-timer.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/core/dbus-timer.c b/src/core/dbus-timer.c index 212f9e1..321ed5d 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; -- 2.7.4