am 68a651e7: Merge "libc: libc_logging 64bit compile issue"

* commit '68a651e7162b922a2916da524ef9706276640752':
  libc: libc_logging 64bit compile issue
This commit is contained in:
Mark Salyzyn 2014-03-06 01:08:55 +00:00 committed by Android Git Automerger
commit a6bd876e3d

View File

@ -478,6 +478,11 @@ static int __libc_open_log_socket()
return log_fd; return log_fd;
} }
struct log_time { // Wire format
uint32_t tv_sec;
uint32_t tv_nsec;
};
#endif #endif
static int __libc_write_log(int priority, const char* tag, const char* msg) { static int __libc_write_log(int priority, const char* tag, const char* msg) {
@ -493,8 +498,11 @@ static int __libc_write_log(int priority, const char* tag, const char* msg) {
char log_id = LOG_ID_MAIN; char log_id = LOG_ID_MAIN;
vec[0].iov_base = &log_id; vec[0].iov_base = &log_id;
vec[0].iov_len = sizeof(log_id); vec[0].iov_len = sizeof(log_id);
timespec realtime_ts; timespec ts;
clock_gettime(CLOCK_REALTIME, &realtime_ts); clock_gettime(CLOCK_REALTIME, &ts);
log_time realtime_ts;
realtime_ts.tv_sec = ts.tv_sec;
realtime_ts.tv_nsec = ts.tv_nsec;
vec[1].iov_base = &realtime_ts; vec[1].iov_base = &realtime_ts;
vec[1].iov_len = sizeof(realtime_ts); vec[1].iov_len = sizeof(realtime_ts);
@ -549,8 +557,11 @@ static int __libc_android_log_event(int32_t tag, char type, const void* payload,
char log_id = LOG_ID_EVENTS; char log_id = LOG_ID_EVENTS;
vec[0].iov_base = &log_id; vec[0].iov_base = &log_id;
vec[0].iov_len = sizeof(log_id); vec[0].iov_len = sizeof(log_id);
timespec realtime_ts; timespec ts;
clock_gettime(CLOCK_REALTIME, &realtime_ts); clock_gettime(CLOCK_REALTIME, &ts);
log_time realtime_ts;
realtime_ts.tv_sec = ts.tv_sec;
realtime_ts.tv_nsec = ts.tv_nsec;
vec[1].iov_base = &realtime_ts; vec[1].iov_base = &realtime_ts;
vec[1].iov_len = sizeof(realtime_ts); vec[1].iov_len = sizeof(realtime_ts);