]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journal: add void cast to journal_file_close() calls
authorVito Caputo <vito.caputo@coreos.com>
Sat, 20 Feb 2016 00:51:41 +0000 (16:51 -0800)
committerVito Caputo <vito.caputo@coreos.com>
Sat, 20 Feb 2016 02:50:16 +0000 (18:50 -0800)
src/journal/journal-file.c
src/journal/journald-server.c
src/journal/sd-journal.c
src/journal/test-journal-flush.c
src/journal/test-journal-interleaving.c
src/journal/test-journal-stream.c
src/journal/test-journal-verify.c
src/journal/test-journal.c

index ccb689451ed1401dc8a8b618ae0cc8dafe71a4d4..52110aa498174b8b106a1f91693aaf077488ee94 100644 (file)
@@ -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;
 }
index ee2db8d29fe5e17c70f75c5f04ecfd81d4dc7780..5e120fdac08cec659ed6287051a5f6b35f31c22f 100644 (file)
@@ -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);
 
index 5a2a28a8d425aff7be6d1fc55fbf31ba8fa62a10..9bc4215f2e307d03af87bae9ba01e710484ea799 100644 (file)
@@ -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);
 
index 7bd9c403668c0e8a4ca0f0721b4dc0214bd2fabc..0c35d532c6e3ba8fc37fcdfae793934169ff3d37 100644 (file)
@@ -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);
index 7f94990888e001f52ee9d4543df6ca0bd87ed0fb..6c6238cc4be75d28e4addee6c5b9c8f285a968da 100644 (file)
@@ -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) {
index 4e6f8c0f7b451237812f670f288fe252af64c4f7..82543bb5f958461c5ca906d1e9fbf89aece9541b 100644 (file)
@@ -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);
 
index a26c624f41eb4d9cfb0f4f79357a7890b21309f9..3fec18c480c55ff9012fefdd134304e45b3cfe80 100644 (file)
@@ -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...");
index 0334b1cd1a26268988e17ff0d143f63080fa9040..94d26a257370e34ebb0bc31546f9466ab568f9aa 100644 (file)
@@ -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[]) {