diff options
author | Andy McFadden <fadden@android.com> | 2009-11-30 17:09:45 -0800 |
---|---|---|
committer | Andy McFadden <fadden@android.com> | 2009-11-30 17:09:45 -0800 |
commit | 5cdb2b73d269580b66297c84d9395f5f9b62d963 (patch) | |
tree | 9319975ceb566a944f32c4ca5e2daead8a19bfa5 /libc/bionic/logd_write.c | |
parent | 3bbac05726e0d42db333d0578fc9de9f2c5e910d (diff) | |
download | bionic-5cdb2b73d269580b66297c84d9395f5f9b62d963.zip bionic-5cdb2b73d269580b66297c84d9395f5f9b62d963.tar.gz bionic-5cdb2b73d269580b66297c84d9395f5f9b62d963.tar.bz2 |
Fix libc logging implementation.
The file descriptor wasn't getting set, so the writev() call was
silently failing.
There's a parallel implementation over in system/core/liblog, but it's
still using the old approach and didn't have this problem.
Diffstat (limited to 'libc/bionic/logd_write.c')
-rw-r--r-- | libc/bionic/logd_write.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libc/bionic/logd_write.c b/libc/bionic/logd_write.c index 3336428..2c5bf42 100644 --- a/libc/bionic/logd_write.c +++ b/libc/bionic/logd_write.c @@ -66,7 +66,7 @@ static int __write_to_log_null(log_id_t log_id, struct iovec *vec); static pthread_mutex_t log_init_lock = PTHREAD_MUTEX_INITIALIZER; -log_channel_t log_channels[LOG_ID_MAX] = { +static log_channel_t log_channels[LOG_ID_MAX] = { { __write_to_log_null, -1, NULL }, { __write_to_log_init, -1, "/dev/"LOGGER_LOG_MAIN }, { __write_to_log_init, -1, "/dev/"LOGGER_LOG_RADIO } @@ -112,6 +112,7 @@ static int __write_to_log_init(log_id_t log_id, struct iovec *vec) log_channels[log_id].logger = (fd < 0) ? __write_to_log_null : __write_to_log_kernel; + log_channels[log_id].fd = fd; pthread_mutex_unlock(&log_init_lock); |