chiark / gitweb /
journal: fix parsing of monotonic kernel timestamps
authorLennart Poettering <lennart@poettering.net>
Fri, 26 Oct 2012 12:55:03 +0000 (14:55 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 26 Oct 2012 12:56:41 +0000 (14:56 +0200)
TODO
src/journal/journald-kmsg.c

diff --git a/TODO b/TODO
index 0faa58d0356169e2457aed90cefee89d1e0d0bbc..d82fca02e6da03c823ade2c457fb6876ab064917 100644 (file)
--- a/TODO
+++ b/TODO
@@ -13,8 +13,6 @@ Bugfixes:
 
 * properly handle .mount unit state tracking when two mount points are stacked one on top of another on the exact same mount point.
 
-* _SOURCE_MONOTONIC_TIMESTAMP entries from the kernel seem to be off by 1000000
-
 F18:
 
 * Retest multi-seat
index 548f65311ce0e502f149adb86824f94613df5114..86786cef551fdfa4d6628f264ad3837ce4374bbb 100644 (file)
@@ -109,7 +109,7 @@ static void dev_kmsg_record(Server *s, char *p, size_t l) {
         char *message = NULL, *syslog_priority = NULL, *syslog_pid = NULL, *syslog_facility = NULL, *syslog_identifier = NULL, *source_time = NULL;
         int priority, r;
         unsigned n = 0, z = 0, j;
-        usec_t usec;
+        unsigned long long usec;
         char *identifier = NULL, *pid = NULL, *e, *f, *k;
         uint64_t serial;
         size_t pl;
@@ -171,7 +171,7 @@ static void dev_kmsg_record(Server *s, char *p, size_t l) {
                 e = f;
         *e = 0;
 
-        r = parse_usec(p, &usec);
+        r = safe_atollu(p, &usec);
         if (r < 0)
                 return;
 
@@ -263,8 +263,7 @@ static void dev_kmsg_record(Server *s, char *p, size_t l) {
                 }
         }
 
-        if (asprintf(&source_time, "_SOURCE_MONOTONIC_TIMESTAMP=%llu",
-                     (unsigned long long) usec) >= 0)
+        if (asprintf(&source_time, "_SOURCE_MONOTONIC_TIMESTAMP=%llu", usec) >= 0)
                 IOVEC_SET_STRING(iovec[n++], source_time);
 
         IOVEC_SET_STRING(iovec[n++], "_TRANSPORT=kernel");