From d4739bc4d3066d589db53f6ad8bd18ef4c08a3c8 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Tue, 25 Aug 2020 11:56:27 -0700 Subject: [PATCH] sd-journal: narrow scope of boot id variable Something trivial I noticed during some unrelated code spelunking --- src/journal/sd-journal.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c index 6fb0abb419d..2023cc0c010 100644 --- a/src/journal/sd-journal.c +++ b/src/journal/sd-journal.c @@ -2219,7 +2219,6 @@ _public_ int sd_journal_get_monotonic_usec(sd_journal *j, uint64_t *ret, sd_id12 Object *o; JournalFile *f; int r; - sd_id128_t id; assert_return(j, -EINVAL); assert_return(!journal_pid_changed(j), -ECHILD); @@ -2238,6 +2237,8 @@ _public_ int sd_journal_get_monotonic_usec(sd_journal *j, uint64_t *ret, sd_id12 if (ret_boot_id) *ret_boot_id = o->entry.boot_id; else { + sd_id128_t id; + r = sd_id128_get_boot(&id); if (r < 0) return r; -- 2.47.3