mirror of
https://github.com/systemd/systemd.git
synced 2024-11-01 09:21:26 +03:00
journal: correctly convert usec_t to timespec.
Use timespec_store instead of (incorrectly) doing it inline.
This commit is contained in:
parent
1307c3ff9a
commit
ca26701624
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user