]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-journal-flush: allow testing against specific files
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 26 Nov 2021 08:40:51 +0000 (09:40 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 26 Nov 2021 08:48:15 +0000 (09:48 +0100)
>=0 → ==0 because sd_journal_open* are documented to return 0.

src/libsystemd/sd-journal/test-journal-flush.c

index dad277dd662118607e612a3eb0d2a9e446f13304..aa814225dda81dd25bf219e77dfa38a4c278e0ce 100644 (file)
@@ -29,8 +29,11 @@ int main(int argc, char *argv[]) {
         r = journal_file_open(-1, fn, O_CREAT|O_RDWR, 0644, false, 0, false, NULL, NULL, NULL, NULL, &new_journal);
         assert_se(r >= 0);
 
-        r = sd_journal_open(&j, 0);
-        assert_se(r >= 0);
+        if (argc > 1)
+                r = sd_journal_open_files(&j, (const char **) strv_skip(argv, 1), 0);
+        else
+                r = sd_journal_open(&j, 0);
+        assert_se(r == 0);
 
         sd_journal_set_data_threshold(j, 0);