logd: liblog: 64-bit issues
- structure packing
- move towards log_time from struct timespec
- extend log_time to cover differences between
log_time and struct timespec
Change-Id: I106ed0b609917306d170044054b5b32645f2a295
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 @@
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);