Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 1 | From 9eff8799831961c0edf6e37e5d4cbf43baa7c748 Mon Sep 17 00:00:00 2001 |
| 2 | From: Fathi Boudra <fabo@debian.org> |
| 3 | Date: Wed, 7 Sep 2016 12:58:47 +0300 |
| 4 | Subject: [PATCH] Remove bionic specific calls |
| 5 | |
| 6 | Upstream-Status: Inappropriate |
| 7 | --- |
| 8 | include/cutils/properties.h | 1 - |
| 9 | libcutils/properties.c | 2 +- |
| 10 | liblog/logd_write.c | 5 +++++ |
| 11 | 3 files changed, 6 insertions(+), 2 deletions(-) |
| 12 | |
| 13 | diff --git a/include/cutils/properties.h b/include/cutils/properties.h |
| 14 | index 798db8b36f..7d01f28d6e 100644 |
| 15 | --- a/include/cutils/properties.h |
| 16 | +++ b/include/cutils/properties.h |
| 17 | @@ -19,7 +19,6 @@ |
| 18 | |
| 19 | #include <sys/cdefs.h> |
| 20 | #include <stddef.h> |
| 21 | -#include <sys/system_properties.h> |
| 22 | #include <stdint.h> |
| 23 | |
| 24 | #ifdef __cplusplus |
| 25 | diff --git a/libcutils/properties.c b/libcutils/properties.c |
| 26 | index b283658aa4..4151e7882c 100644 |
| 27 | --- a/libcutils/properties.c |
| 28 | +++ b/libcutils/properties.c |
| 29 | @@ -104,10 +104,10 @@ int32_t property_get_int32(const char *key, int32_t default_value) { |
| 30 | return (int32_t)property_get_imax(key, INT32_MIN, INT32_MAX, default_value); |
| 31 | } |
| 32 | |
| 33 | +#undef HAVE_LIBC_SYSTEM_PROPERTIES |
| 34 | #ifdef HAVE_LIBC_SYSTEM_PROPERTIES |
| 35 | |
| 36 | #define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_ |
| 37 | -#include <sys/_system_properties.h> |
| 38 | |
| 39 | int property_set(const char *key, const char *value) |
| 40 | { |
| 41 | diff --git a/liblog/logd_write.c b/liblog/logd_write.c |
| 42 | index b2668cedb7..f5a44fe901 100644 |
| 43 | --- a/liblog/logd_write.c |
| 44 | +++ b/liblog/logd_write.c |
| 45 | @@ -23,6 +23,7 @@ |
| 46 | #include <stdlib.h> |
| 47 | #include <string.h> |
| 48 | #include <sys/stat.h> |
| 49 | +#include <sys/syscall.h> |
| 50 | #include <sys/types.h> |
| 51 | #if (FAKE_LOG_DEVICE == 0) |
| 52 | #include <sys/socket.h> |
| 53 | @@ -205,7 +206,11 @@ static int __write_to_log_kernel(log_id_t log_id, struct iovec *vec, size_t nr) |
| 54 | realtime_ts.tv_nsec = ts.tv_nsec; |
| 55 | |
| 56 | log_id_buf = log_id; |
| 57 | +#ifdef __BIONIC__ |
| 58 | tid = gettid(); |
| 59 | +#else |
| 60 | + tid = (pid_t) syscall(__NR_gettid); |
| 61 | +#endif |
| 62 | |
| 63 | newVec[0].iov_base = (unsigned char *) &log_id_buf; |
| 64 | newVec[0].iov_len = sizeof_log_id_t; |