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.
This commit is contained in:
Yu Watanabe
2024-05-10 11:43:57 +09:00
parent 8f2bcb1fb2
commit 5da5d848f9
+2 -1
View File
@@ -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)