Loading liblog/logd_write.c +10 −7 Original line number Diff line number Diff line Loading @@ -159,10 +159,14 @@ static int __write_to_log_kernel(log_id_t log_id, struct iovec *vec, size_t nr) struct timespec ts; log_time realtime_ts; size_t i, payload_size; static uid_t last_uid = AID_ROOT; /* logd *always* starts up as AID_ROOT */ if (getuid() == AID_LOGD) { if (last_uid == AID_ROOT) { /* have we called to get the UID yet? */ last_uid = getuid(); } if (last_uid == AID_LOGD) { /* logd, after initialization and priv drop */ /* * ignore log messages we send to ourself. * ignore log messages we send to ourself (logd). * Such log messages are often generated by libraries we depend on * which use standard Android logging. */ Loading Loading @@ -193,6 +197,10 @@ static int __write_to_log_kernel(log_id_t log_id, struct iovec *vec, size_t nr) * }; */ clock_gettime(CLOCK_REALTIME, &ts); realtime_ts.tv_sec = ts.tv_sec; realtime_ts.tv_nsec = ts.tv_nsec; log_id_buf = log_id; tid = gettid(); Loading @@ -200,11 +208,6 @@ static int __write_to_log_kernel(log_id_t log_id, struct iovec *vec, size_t nr) newVec[0].iov_len = sizeof_log_id_t; newVec[1].iov_base = (unsigned char *) &tid; newVec[1].iov_len = sizeof(tid); clock_gettime(CLOCK_REALTIME, &ts); realtime_ts.tv_sec = ts.tv_sec; realtime_ts.tv_nsec = ts.tv_nsec; newVec[2].iov_base = (unsigned char *) &realtime_ts; newVec[2].iov_len = sizeof(log_time); Loading Loading
liblog/logd_write.c +10 −7 Original line number Diff line number Diff line Loading @@ -159,10 +159,14 @@ static int __write_to_log_kernel(log_id_t log_id, struct iovec *vec, size_t nr) struct timespec ts; log_time realtime_ts; size_t i, payload_size; static uid_t last_uid = AID_ROOT; /* logd *always* starts up as AID_ROOT */ if (getuid() == AID_LOGD) { if (last_uid == AID_ROOT) { /* have we called to get the UID yet? */ last_uid = getuid(); } if (last_uid == AID_LOGD) { /* logd, after initialization and priv drop */ /* * ignore log messages we send to ourself. * ignore log messages we send to ourself (logd). * Such log messages are often generated by libraries we depend on * which use standard Android logging. */ Loading Loading @@ -193,6 +197,10 @@ static int __write_to_log_kernel(log_id_t log_id, struct iovec *vec, size_t nr) * }; */ clock_gettime(CLOCK_REALTIME, &ts); realtime_ts.tv_sec = ts.tv_sec; realtime_ts.tv_nsec = ts.tv_nsec; log_id_buf = log_id; tid = gettid(); Loading @@ -200,11 +208,6 @@ static int __write_to_log_kernel(log_id_t log_id, struct iovec *vec, size_t nr) newVec[0].iov_len = sizeof_log_id_t; newVec[1].iov_base = (unsigned char *) &tid; newVec[1].iov_len = sizeof(tid); clock_gettime(CLOCK_REALTIME, &ts); realtime_ts.tv_sec = ts.tv_sec; realtime_ts.tv_nsec = ts.tv_nsec; newVec[2].iov_base = (unsigned char *) &realtime_ts; newVec[2].iov_len = sizeof(log_time); Loading