coredumpctl: fix spurious "more than one entry matches" warning
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 26 Sep 2016 22:40:55 +0000 (00:40 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 28 Sep 2016 21:49:01 +0000 (23:49 +0200)
sd_journal_previous() returns 0 if it didn't do any move, so the
warning was stupidly always printed.

src/coredump/coredumpctl.c

index 05a0970..45ce31e 100644 (file)
@@ -706,7 +706,7 @@ static int dump_core(sd_journal* j) {
                 return log_error_errno(r, "Coredump retrieval failed: %m");
 
         r = sd_journal_previous(j);
-        if (r >= 0)
+        if (r > 0)
                 log_warning("More than one entry matches, ignoring rest.");
 
         return 0;