From: Yu Watanabe Date: Mon, 27 Jun 2022 02:28:36 +0000 (+0900) Subject: sd-journal: shorten code a bit X-Git-Tag: v252-rc1~755^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=586fb79e274d230a6e9c8169c2ad71d78302e56d;p=thirdparty%2Fsystemd.git sd-journal: shorten code a bit --- diff --git a/src/libsystemd/sd-journal/journal-file.c b/src/libsystemd/sd-journal/journal-file.c index f268abede7f..517b01543f0 100644 --- a/src/libsystemd/sd-journal/journal-file.c +++ b/src/libsystemd/sd-journal/journal-file.c @@ -799,7 +799,6 @@ static int journal_file_check_object(JournalFile *f, uint64_t offset, Object *o) int journal_file_move_to_object(JournalFile *f, ObjectType type, uint64_t offset, Object **ret) { int r; - void *t; Object *o; uint64_t s; @@ -817,11 +816,10 @@ int journal_file_move_to_object(JournalFile *f, ObjectType type, uint64_t offset "Attempt to move to object located in file header: %" PRIu64, offset); - r = journal_file_move_to(f, type, false, offset, sizeof(ObjectHeader), &t); + r = journal_file_move_to(f, type, false, offset, sizeof(ObjectHeader), (void**) &o); if (r < 0) return r; - o = (Object*) t; s = le64toh(READ_NOW(o->object.size)); if (s == 0) @@ -848,12 +846,10 @@ int journal_file_move_to_object(JournalFile *f, ObjectType type, uint64_t offset "Attempt to move to object of unexpected type: %" PRIu64, offset); - r = journal_file_move_to(f, type, false, offset, s, &t); + r = journal_file_move_to(f, type, false, offset, s, (void**) &o); if (r < 0) return r; - o = (Object*) t; - r = journal_file_check_object(f, offset, o); if (r < 0) return r; @@ -976,7 +972,6 @@ int journal_file_append_object( int r; uint64_t p; Object *o; - void *t; assert(f); assert(f->header); @@ -995,11 +990,10 @@ int journal_file_append_object( if (r < 0) return r; - r = journal_file_move_to(f, type, false, p, size, &t); + r = journal_file_move_to(f, type, false, p, size, (void**) &o); if (r < 0) return r; - o = (Object*) t; o->object = (ObjectHeader) { .type = type, .size = htole64(size),