summaryrefslogtreecommitdiffstats
path: root/src/journal/journal-file.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-11-16 08:51:17 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-11-16 09:03:41 +0100
commitca5d90d4d99dc1a6196459b5fc54f603099969a9 (patch)
tree40137696667a616ef31a8049e70f381760dcfb3a /src/journal/journal-file.c
parentsd-event: make sd_event_source_get_enabled return more info (diff)
downloadsystemd-ca5d90d4d99dc1a6196459b5fc54f603099969a9.tar.xz
systemd-ca5d90d4d99dc1a6196459b5fc54f603099969a9.zip
journal-file: get rid of a helper variable
It doesn't really save much in code length. Having the event source named explicitly makes it easier to understand the code at a glance.
Diffstat (limited to '')
-rw-r--r--src/journal/journal-file.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index 14da087f24..ea1e450344 100644
--- a/src/journal/journal-file.c
+++ b/src/journal/journal-file.c
@@ -1869,16 +1869,13 @@ static int post_change_thunk(sd_event_source *timer, uint64_t usec, void *userda
}
static void schedule_post_change(JournalFile *f) {
- sd_event_source *timer;
int enabled, r;
uint64_t now;
assert(f);
assert(f->post_change_timer);
- timer = f->post_change_timer;
-
- r = sd_event_source_get_enabled(timer, &enabled);
+ r = sd_event_source_get_enabled(f->post_change_timer, &enabled);
if (r < 0) {
log_debug_errno(r, "Failed to get ftruncate timer state: %m");
goto fail;
@@ -1887,19 +1884,19 @@ static void schedule_post_change(JournalFile *f) {
if (enabled == SD_EVENT_ONESHOT)
return;
- r = sd_event_now(sd_event_source_get_event(timer), CLOCK_MONOTONIC, &now);
+ r = sd_event_now(sd_event_source_get_event(f->post_change_timer), CLOCK_MONOTONIC, &now);
if (r < 0) {
log_debug_errno(r, "Failed to get clock's now for scheduling ftruncate: %m");
goto fail;
}
- r = sd_event_source_set_time(timer, now+f->post_change_timer_period);
+ r = sd_event_source_set_time(f->post_change_timer, now + f->post_change_timer_period);
if (r < 0) {
log_debug_errno(r, "Failed to set time for scheduling ftruncate: %m");
goto fail;
}
- r = sd_event_source_set_enabled(timer, SD_EVENT_ONESHOT);
+ r = sd_event_source_set_enabled(f->post_change_timer, SD_EVENT_ONESHOT);
if (r < 0) {
log_debug_errno(r, "Failed to enable scheduled ftruncate: %m");
goto fail;