summaryrefslogtreecommitdiffstats
path: root/liblog/logd_write.c
diff options
context:
space:
mode:
Diffstat (limited to 'liblog/logd_write.c')
-rw-r--r--liblog/logd_write.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/liblog/logd_write.c b/liblog/logd_write.c
index d3ee167..c3efc33 100644
--- a/liblog/logd_write.c
+++ b/liblog/logd_write.c
@@ -117,8 +117,11 @@ static int __write_to_log_kernel(log_id_t log_id, struct iovec *vec, size_t nr)
newVec[0].iov_base = (unsigned char *) &log_id_buf;
newVec[0].iov_len = sizeof_log_id_t;
+ struct timespec ts;
+ clock_gettime(CLOCK_REALTIME, &ts);
log_time realtime_ts;
- clock_gettime(CLOCK_REALTIME, &realtime_ts);
+ realtime_ts.tv_sec = ts.tv_sec;
+ realtime_ts.tv_nsec = ts.tv_nsec;
newVec[1].iov_base = (unsigned char *) &realtime_ts;
newVec[1].iov_len = sizeof(log_time);