summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-10-26 14:55:03 +0200
committerLennart Poettering <lennart@poettering.net>2012-10-26 14:56:41 +0200
commite9f600f2fb4b0df55c7a8fb4b4d09f9979997223 (patch)
treef2451bb33e80f6331bd85d2ce1f2167e9d809c6e /src
parent221a6c2a26d8e4de207adf216f2f30e43b4aa492 (diff)
journal: fix parsing of monotonic kernel timestamps
Diffstat (limited to 'src')
-rw-r--r--src/journal/journald-kmsg.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/journal/journald-kmsg.c b/src/journal/journald-kmsg.c
index 548f65311c..86786cef55 100644
--- a/src/journal/journald-kmsg.c
+++ b/src/journal/journald-kmsg.c
@@ -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");