journal: add void cast to journal_file_close() calls
This commit is contained in:
@@ -2898,7 +2898,7 @@ fail:
|
||||
if (f->fd >= 0 && mmap_cache_got_sigbus(f->mmap, f->fd))
|
||||
r = -EIO;
|
||||
|
||||
journal_file_close(f);
|
||||
(void) journal_file_close(f);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -259,7 +259,7 @@ static int open_journal(
|
||||
|
||||
r = journal_file_enable_post_change_timer(f, s->event, POST_CHANGE_TIMER_INTERVAL_USEC);
|
||||
if (r < 0) {
|
||||
journal_file_close(f);
|
||||
(void) journal_file_close(f);
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -302,7 +302,7 @@ static JournalFile* find_journal(Server *s, uid_t uid) {
|
||||
/* Too many open? Then let's close one */
|
||||
f = ordered_hashmap_steal_first(s->user_journals);
|
||||
assert(f);
|
||||
journal_file_close(f);
|
||||
(void) journal_file_close(f);
|
||||
}
|
||||
|
||||
r = open_journal(s, true, p, O_RDWR|O_CREAT, s->seal, &s->system_metrics, &f);
|
||||
@@ -313,7 +313,7 @@ static JournalFile* find_journal(Server *s, uid_t uid) {
|
||||
|
||||
r = ordered_hashmap_put(s->user_journals, UID_TO_PTR(uid), f);
|
||||
if (r < 0) {
|
||||
journal_file_close(f);
|
||||
(void) journal_file_close(f);
|
||||
return s->system_journal;
|
||||
}
|
||||
|
||||
@@ -1922,13 +1922,13 @@ void server_done(Server *s) {
|
||||
stdout_stream_free(s->stdout_streams);
|
||||
|
||||
if (s->system_journal)
|
||||
journal_file_close(s->system_journal);
|
||||
(void) journal_file_close(s->system_journal);
|
||||
|
||||
if (s->runtime_journal)
|
||||
journal_file_close(s->runtime_journal);
|
||||
(void) journal_file_close(s->runtime_journal);
|
||||
|
||||
while ((f = ordered_hashmap_steal_first(s->user_journals)))
|
||||
journal_file_close(f);
|
||||
(void) journal_file_close(f);
|
||||
|
||||
ordered_hashmap_free(s->user_journals);
|
||||
|
||||
|
||||
@@ -1258,7 +1258,7 @@ static int add_any_file(sd_journal *j, const char *path) {
|
||||
|
||||
r = ordered_hashmap_put(j->files, f->path, f);
|
||||
if (r < 0) {
|
||||
journal_file_close(f);
|
||||
(void) journal_file_close(f);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -1343,7 +1343,7 @@ static void remove_file_real(sd_journal *j, JournalFile *f) {
|
||||
j->fields_file_lost = true;
|
||||
}
|
||||
|
||||
journal_file_close(f);
|
||||
(void) journal_file_close(f);
|
||||
|
||||
j->current_invalidate_counter ++;
|
||||
}
|
||||
@@ -1784,7 +1784,7 @@ _public_ void sd_journal_close(sd_journal *j) {
|
||||
sd_journal_flush_matches(j);
|
||||
|
||||
while ((f = ordered_hashmap_steal_first(j->files)))
|
||||
journal_file_close(f);
|
||||
(void) journal_file_close(f);
|
||||
|
||||
ordered_hashmap_free(j->files);
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
sd_journal_close(j);
|
||||
|
||||
journal_file_close(new_journal);
|
||||
(void) journal_file_close(new_journal);
|
||||
|
||||
unlink(fn);
|
||||
assert_se(rmdir(dn) == 0);
|
||||
|
||||
@@ -57,7 +57,7 @@ static JournalFile *test_open(const char *name) {
|
||||
}
|
||||
|
||||
static void test_close(JournalFile *f) {
|
||||
journal_file_close (f);
|
||||
(void) journal_file_close (f);
|
||||
}
|
||||
|
||||
static void append_number(JournalFile *f, int n, uint64_t *seqnum) {
|
||||
|
||||
@@ -133,9 +133,9 @@ int main(int argc, char *argv[]) {
|
||||
free(q);
|
||||
}
|
||||
|
||||
journal_file_close(one);
|
||||
journal_file_close(two);
|
||||
journal_file_close(three);
|
||||
(void) journal_file_close(one);
|
||||
(void) journal_file_close(two);
|
||||
(void) journal_file_close(three);
|
||||
|
||||
assert_se(sd_journal_open_directory(&j, t, 0) >= 0);
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ static int raw_verify(const char *fn, const char *verification_key) {
|
||||
return r;
|
||||
|
||||
r = journal_file_verify(f, verification_key, NULL, NULL, NULL, false);
|
||||
journal_file_close(f);
|
||||
(void) journal_file_close(f);
|
||||
|
||||
return r;
|
||||
}
|
||||
@@ -107,7 +107,7 @@ int main(int argc, char *argv[]) {
|
||||
free(test);
|
||||
}
|
||||
|
||||
journal_file_close(f);
|
||||
(void) journal_file_close(f);
|
||||
|
||||
log_info("Verifying...");
|
||||
|
||||
@@ -123,7 +123,7 @@ int main(int argc, char *argv[]) {
|
||||
format_timestamp(b, sizeof(b), to),
|
||||
format_timespan(c, sizeof(c), total > to ? total - to : 0, 0));
|
||||
|
||||
journal_file_close(f);
|
||||
(void) journal_file_close(f);
|
||||
|
||||
if (verification_key) {
|
||||
log_info("Toggling bits...");
|
||||
|
||||
@@ -107,7 +107,7 @@ static void test_non_empty(void) {
|
||||
journal_file_rotate(&f, true, true);
|
||||
journal_file_rotate(&f, true, true);
|
||||
|
||||
journal_file_close(f);
|
||||
(void) journal_file_close(f);
|
||||
|
||||
log_info("Done...");
|
||||
|
||||
@@ -158,10 +158,10 @@ static void test_empty(void) {
|
||||
assert_se(rm_rf(t, REMOVE_ROOT|REMOVE_PHYSICAL) >= 0);
|
||||
}
|
||||
|
||||
journal_file_close(f1);
|
||||
journal_file_close(f2);
|
||||
journal_file_close(f3);
|
||||
journal_file_close(f4);
|
||||
(void) journal_file_close(f1);
|
||||
(void) journal_file_close(f2);
|
||||
(void) journal_file_close(f3);
|
||||
(void) journal_file_close(f4);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
Reference in New Issue
Block a user