]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-journal: narrow scope of boot id variable
authorVito Caputo <vcaputo@pengaru.com>
Tue, 25 Aug 2020 18:56:27 +0000 (11:56 -0700)
committerLennart Poettering <lennart@poettering.net>
Tue, 25 Aug 2020 20:41:35 +0000 (22:41 +0200)
Something trivial I noticed during some unrelated code spelunking

src/journal/sd-journal.c

index 6fb0abb419d9e97f23083071537d813818c91c51..2023cc0c01041e1e0a35eced67e43e8dc1ce4c7c 100644 (file)
@@ -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;