deprecate TARGET_USES_LOGD
This is not the kernel logger you are looking for
Bug: 22787659
Change-Id: I340d8bb5cdaa73be9565521681ee238b7033934b
diff --git a/libc/Android.mk b/libc/Android.mk
index 5e09cf9..2f0c723 100644
--- a/libc/Android.mk
+++ b/libc/Android.mk
@@ -577,10 +577,6 @@
-D_LIBC=1 \
-Wall -Wextra -Wunused \
-ifneq ($(TARGET_USES_LOGD),false)
-libc_common_cflags += -DTARGET_USES_LOGD
-endif
-
use_clang := $(USE_CLANG_PLATFORM_BUILD)
# Clang/llvm has incompatible long double (fp128) for x86_64.
diff --git a/libc/bionic/libc_logging.cpp b/libc/bionic/libc_logging.cpp
index cb0b334..2a987b9 100644
--- a/libc/bionic/libc_logging.cpp
+++ b/libc/bionic/libc_logging.cpp
@@ -448,7 +448,6 @@
return result;
}
-#ifdef TARGET_USES_LOGD
static int __libc_open_log_socket() {
// ToDo: Ideally we want this to fail if the gid of the current
// process is AID_LOGD, but will have to wait until we have
@@ -486,10 +485,8 @@
uint32_t tv_sec;
uint32_t tv_nsec;
};
-#endif
static int __libc_write_log(int priority, const char* tag, const char* msg) {
-#ifdef TARGET_USES_LOGD
int main_log_fd = __libc_open_log_socket();
if (main_log_fd == -1) {
// Try stderr instead.
@@ -517,24 +514,6 @@
vec[4].iov_len = strlen(tag) + 1;
vec[5].iov_base = const_cast<char*>(msg);
vec[5].iov_len = strlen(msg) + 1;
-#else
- int main_log_fd = TEMP_FAILURE_RETRY(open("/dev/log/main", O_CLOEXEC | O_WRONLY));
- if (main_log_fd == -1) {
- if (errno == ENOTDIR) {
- // /dev/log isn't a directory? Maybe we're running on the host? Try stderr instead.
- return __libc_write_stderr(tag, msg);
- }
- return -1;
- }
-
- iovec vec[3];
- vec[0].iov_base = &priority;
- vec[0].iov_len = 1;
- vec[1].iov_base = const_cast<char*>(tag);
- vec[1].iov_len = strlen(tag) + 1;
- vec[2].iov_base = const_cast<char*>(msg);
- vec[2].iov_len = strlen(msg) + 1;
-#endif
int result = TEMP_FAILURE_RETRY(writev(main_log_fd, vec, sizeof(vec) / sizeof(vec[0])));
close(main_log_fd);
@@ -557,7 +536,6 @@
}
static int __libc_android_log_event(int32_t tag, char type, const void* payload, size_t len) {
-#ifdef TARGET_USES_LOGD
iovec vec[6];
char log_id = LOG_ID_EVENTS;
vec[0].iov_base = &log_id;
@@ -581,17 +559,6 @@
vec[5].iov_len = len;
int event_log_fd = __libc_open_log_socket();
-#else
- iovec vec[3];
- vec[0].iov_base = &tag;
- vec[0].iov_len = sizeof(tag);
- vec[1].iov_base = &type;
- vec[1].iov_len = sizeof(type);
- vec[2].iov_base = const_cast<void*>(payload);
- vec[2].iov_len = len;
-
- int event_log_fd = TEMP_FAILURE_RETRY(open("/dev/log/events", O_CLOEXEC | O_WRONLY));
-#endif
if (event_log_fd == -1) {
return -1;