summaryrefslogtreecommitdiff
path: root/src/journal/journald-server.c
diff options
context:
space:
mode:
authorMichał Bartoszkiewicz <mbartoszkiewicz@gmail.com>2013-05-15 11:28:58 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-05-15 21:02:46 -0400
commitca2670162464b98f44d3f30a1d8b47b02609784c (patch)
tree09717ef613a18cff107d808b5007ac5ffa1315b5 /src/journal/journald-server.c
parent1307c3ff9aa9d96fff6f9f42bb760887fa9aa240 (diff)
journal: correctly convert usec_t to timespec.
Use timespec_store instead of (incorrectly) doing it inline.
Diffstat (limited to 'src/journal/journald-server.c')
-rw-r--r--src/journal/journald-server.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index cc52b8a5c9..b717b92ffb 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -1332,10 +1332,9 @@ int server_schedule_sync(Server *s) {
return 0;
if (s->sync_interval_usec) {
- struct itimerspec sync_timer_enable = {
- .it_value.tv_sec = s->sync_interval_usec / USEC_PER_SEC,
- .it_value.tv_nsec = s->sync_interval_usec % MSEC_PER_SEC,
- };
+ struct itimerspec sync_timer_enable = {};
+
+ timespec_store(&sync_timer_enable.it_value, s->sync_interval_usec);
r = timerfd_settime(s->sync_timer_fd, 0, &sync_timer_enable, NULL);
if (r < 0)