summaryrefslogtreecommitdiff
path: root/src/journal/journald-kmsg.c
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-08-06 13:14:51 +0200
committerLennart Poettering <lennart@poettering.net>2014-08-13 20:50:47 +0200
commitb9c488f60050248b35640f28e4d00958702ba1c3 (patch)
treeb1d3258afb75b0a6a4592a62e3c2b6cb9e0ca047 /src/journal/journald-kmsg.c
parent48776bdacd17e1c2f73238ff8bb6b327760b526d (diff)
journald: Fix off-by-one error in "Missed X kernel messages" warning
On receiving a message, "kernel_seqnum" is set to "serial + 1". So subtracting 1 will cause messages like "Missed 0 kernel messages", which should be "Missed 1 kernel messages".
Diffstat (limited to 'src/journal/journald-kmsg.c')
-rw-r--r--src/journal/journald-kmsg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/journal/journald-kmsg.c b/src/journal/journald-kmsg.c
index 9935986c12..fb8ea08e31 100644
--- a/src/journal/journald-kmsg.c
+++ b/src/journal/journald-kmsg.c
@@ -152,7 +152,7 @@ static void dev_kmsg_record(Server *s, char *p, size_t l) {
/* Did we lose any? */
if (serial > *s->kernel_seqnum)
server_driver_message(s, SD_MESSAGE_JOURNAL_MISSED, "Missed %"PRIu64" kernel messages",
- serial - *s->kernel_seqnum - 1);
+ serial - *s->kernel_seqnum);
/* Make sure we never read this one again. Note that
* we always store the next message serial we expect