chiark / gitweb /
journald: Fix off-by-one error in "Missed X kernel messages" warning
authorEelco Dolstra <eelco.dolstra@logicblox.com>
Wed, 6 Aug 2014 11:14:51 +0000 (13:14 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 13 Aug 2014 18:50:47 +0000 (20:50 +0200)
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".

src/journal/journald-kmsg.c

index 9935986..fb8ea08 100644 (file)
@@ -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