]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - man/journal-iterate-unique.c
test: applying timezone is asynchronous
[thirdparty/systemd.git] / man / journal-iterate-unique.c
index ac0c638032f29089c5b796db4405d80953da8eac..f44303d75cdfb99d2e61a0535af51cfd0b1e873d 100644 (file)
@@ -1,4 +1,4 @@
-/* SPDX-License-Identifier: CC0-1.0 */
+/* SPDX-License-Identifier: MIT-0 */
 
 #include <errno.h>
 #include <stdio.h>
@@ -12,14 +12,12 @@ int main(int argc, char *argv[]) {
 
   r = sd_journal_open(&j, SD_JOURNAL_LOCAL_ONLY);
   if (r < 0) {
-    errno = -r;
-    fprintf(stderr, "Failed to open journal: %m\n");
+    fprintf(stderr, "Failed to open journal: %s\n", strerror(-r));
     return 1;
   }
   r = sd_journal_query_unique(j, "_SYSTEMD_UNIT");
   if (r < 0) {
-    errno = -r;
-    fprintf(stderr, "Failed to query journal: %m\n");
+    fprintf(stderr, "Failed to query journal: %s\n", strerror(-r));
     return 1;
   }
   SD_JOURNAL_FOREACH_UNIQUE(j, d, l)