From: Yu Watanabe Date: Thu, 25 Apr 2024 05:22:41 +0000 (+0900) Subject: journalctl: fail and show error message when no boot ID found X-Git-Tag: v256-rc2~50^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5da5d848f9d5175998e8a1030d32a7edb3371956;p=thirdparty%2Fsystemd.git journalctl: fail and show error message when no boot ID found No boot ID in journal should be definitly spurious. Let's warn about that and exit with failure. --- diff --git a/src/journal/journalctl-misc.c b/src/journal/journalctl-misc.c index 47eb72575ab..65785d4d357 100644 --- a/src/journal/journalctl-misc.c +++ b/src/journal/journalctl-misc.c @@ -115,7 +115,8 @@ int action_list_boots(void) { if (r < 0) return log_error_errno(r, "Failed to determine boots: %m"); if (r == 0) - return 0; + return log_full_errno(arg_quiet ? LOG_DEBUG : LOG_ERR, SYNTHETIC_ERRNO(ENODATA), + "No boot found."); table = table_new("idx", "boot id", "first entry", "last entry"); if (!table)