summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/sanitizer_posix_libcdep.cc
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2015-07-23 01:29:26 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2015-07-23 01:29:26 +0000
commit3cd28f4b83747550a704400dd9efd9e5a21774fe (patch)
tree4a5652f7e5351c17f497ba5aa6819e3c2b7e8762 /lib/sanitizer_common/sanitizer_posix_libcdep.cc
parent721ddfa27c67f3225fb652709259c36ad887bfb7 (diff)
Revert r242975.
Breaks Mac build. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@242978 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_posix_libcdep.cc')
-rw-r--r--lib/sanitizer_common/sanitizer_posix_libcdep.cc54
1 files changed, 2 insertions, 52 deletions
diff --git a/lib/sanitizer_common/sanitizer_posix_libcdep.cc b/lib/sanitizer_common/sanitizer_posix_libcdep.cc
index d0fb65782..3f0a4f453 100644
--- a/lib/sanitizer_common/sanitizer_posix_libcdep.cc
+++ b/lib/sanitizer_common/sanitizer_posix_libcdep.cc
@@ -15,7 +15,6 @@
#include "sanitizer_platform.h"
#if SANITIZER_POSIX
-#include "sanitizer_allocator_internal.h"
#include "sanitizer_common.h"
#include "sanitizer_flags.h"
#include "sanitizer_platform_limits_posix.h"
@@ -31,17 +30,11 @@
#include <stdlib.h>
#include <sys/mman.h>
#include <sys/resource.h>
-#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
+#include <sys/stat.h>
#include <unistd.h>
-#if SANITIZER_ANDROID && __ANDROID_API__ < 21
-#include <android/log.h>
-#else
-#include <syslog.h>
-#endif
-
#if SANITIZER_FREEBSD
// The MAP_NORESERVE define has been removed in FreeBSD 11.x, and even before
// that, it was never implemented. So just define it to zero.
@@ -282,49 +275,6 @@ void *MmapNoAccess(uptr fixed_addr, uptr size, const char *name) {
0);
}
-// 64-bit Android targets don't provide the deprecated __android_log_write.
-// Starting with the L release, syslog() works and is preferable to
-// __android_log_write.
-#if SANITIZER_ANDROID && __ANDROID_API__ < 21
-static atomic_uint8_t android_log_initialized;
-
-void AndroidLogInit() {
- atomic_store(&android_log_initialized, 1, memory_order_release);
-}
-
-static bool IsSyslogAvailable() {
- return atomic_load(&android_log_initialized, memory_order_acquire);
-}
-
-static void WriteOneLineToSyslog(const char *s) {
- __android_log_write(ANDROID_LOG_INFO, NULL, s);
-}
-#else
-void AndroidLogInit() {}
-
-static bool IsSyslogAvailable() { return true; }
-
-static void WriteOneLineToSyslog(const char *s) { syslog(LOG_INFO, "%s", s); }
-#endif
-
-void WriteToSyslog(const char *buffer) {
- if (!IsSyslogAvailable())
- return;
- char *copy = internal_strdup(buffer);
- char *p = copy;
- char *q;
- // syslog, at least on Android, has an implicit message length limit.
- // Print one line at a time.
- do {
- q = internal_strchr(p, '\n');
- if (q)
- *q = '\0';
- WriteOneLineToSyslog(p);
- if (q)
- p = q + 1;
- } while (q);
- InternalFree(copy);
-}
-} // namespace __sanitizer
+} // namespace __sanitizer
#endif // SANITIZER_POSIX