[systemd-devel] [PATCH 2/2] journalctl: print correct timespan in verify

Mirco Tischler mt-ml at gmx.de
Sat Sep 22 12:45:31 PDT 2012


The old code used a timestamp to print a timespan for unsealed journalfiles,
incorrectly showing things like 2230 days of unsealed entries. Print the timespan
between the first and last entry instead.
---
 src/journal/journalctl.c | 2 +-
 1 Datei geändert, 1 Zeile hinzugefügt(+), 1 Zeile entfernt(-)

diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index 6b580d4..2bca53e 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -708,7 +708,7 @@ static int verify(sd_journal *j) {
                                                  format_timespan(c, sizeof(c), total > to ? total - to : 0));
                                 } else if (total > 0)
                                         log_info("=> No sealing yet, %s of entries not sealed.",
-                                                 format_timespan(c, sizeof(c), total));
+                                                 format_timespan(c, sizeof(c), total - f->header->head_entry_realtime));
                                 else
                                         log_info("=> No sealing yet, no entries in file.");
                         }
-- 
1.7.12.1



More information about the systemd-devel mailing list