diff options
| -rw-r--r-- | cmds/dumpstate/utils.c | 18 | ||||
| -rw-r--r-- | libs/binder/ProcessState.cpp | 7 | ||||
| -rw-r--r-- | opengl/libs/Android.mk | 5 | ||||
| -rw-r--r-- | opengl/libs/EGL/Loader.cpp | 21 |
4 files changed, 17 insertions, 34 deletions
diff --git a/cmds/dumpstate/utils.c b/cmds/dumpstate/utils.c index d679787966..0dd0c21a9f 100644 --- a/cmds/dumpstate/utils.c +++ b/cmds/dumpstate/utils.c @@ -626,24 +626,6 @@ const char *dump_traces() { return NULL; // Can't rename old traces.txt -- no permission? -- leave it alone instead } - /* make the directory if necessary */ - char anr_traces_dir[PATH_MAX]; - strlcpy(anr_traces_dir, traces_path, sizeof(anr_traces_dir)); - char *slash = strrchr(anr_traces_dir, '/'); - if (slash != NULL) { - *slash = '\0'; - if (!mkdir(anr_traces_dir, 0775)) { - chown(anr_traces_dir, AID_SYSTEM, AID_SYSTEM); - chmod(anr_traces_dir, 0775); - if (selinux_android_restorecon(anr_traces_dir, 0) == -1) { - fprintf(stderr, "restorecon failed for %s: %s\n", anr_traces_dir, strerror(errno)); - } - } else if (errno != EEXIST) { - fprintf(stderr, "mkdir(%s): %s\n", anr_traces_dir, strerror(errno)); - return NULL; - } - } - /* create a new, empty traces.txt file to receive stack dumps */ int fd = TEMP_FAILURE_RETRY(open(traces_path, O_CREAT | O_WRONLY | O_TRUNC | O_NOFOLLOW | O_CLOEXEC, 0666)); /* -rw-rw-rw- */ diff --git a/libs/binder/ProcessState.cpp b/libs/binder/ProcessState.cpp index 016d3c54b0..821ab6cb9b 100644 --- a/libs/binder/ProcessState.cpp +++ b/libs/binder/ProcessState.cpp @@ -350,10 +350,6 @@ ProcessState::ProcessState() , mThreadPoolSeq(1) { if (mDriverFD >= 0) { - // XXX Ideally, there should be a specific define for whether we - // have mmap (or whether we could possibly have the kernel module - // availabla). -#if !defined(HAVE_WIN32_IPC) // mmap the binder, providing a chunk of virtual address space to receive transactions. mVMStart = mmap(0, BINDER_VM_SIZE, PROT_READ, MAP_PRIVATE | MAP_NORESERVE, mDriverFD, 0); if (mVMStart == MAP_FAILED) { @@ -362,9 +358,6 @@ ProcessState::ProcessState() close(mDriverFD); mDriverFD = -1; } -#else - mDriverFD = -1; -#endif } LOG_ALWAYS_FATAL_IF(mDriverFD < 0, "Binder driver could not be opened. Terminating."); diff --git a/opengl/libs/Android.mk b/opengl/libs/Android.mk index 18ad3003e1..8d426907fd 100644 --- a/opengl/libs/Android.mk +++ b/opengl/libs/Android.mk @@ -59,6 +59,11 @@ ifneq ($(MAX_EGL_CACHE_SIZE),) LOCAL_CFLAGS += -DMAX_EGL_CACHE_SIZE=$(MAX_EGL_CACHE_SIZE) endif +ifeq (address, $(strip $(SANITIZE_TARGET))) + LOCAL_CFLAGS_32 += -DEGL_WRAPPER_DIR=\"/$(TARGET_COPY_OUT_DATA)/lib\" + LOCAL_CFLAGS_64 += -DEGL_WRAPPER_DIR=\"/$(TARGET_COPY_OUT_DATA)/lib64\" +endif + LOCAL_REQUIRED_MODULES := $(egl.cfg_config_module) egl.cfg_config_module := diff --git a/opengl/libs/EGL/Loader.cpp b/opengl/libs/EGL/Loader.cpp index 1fcc048b28..8df9af3e44 100644 --- a/opengl/libs/EGL/Loader.cpp +++ b/opengl/libs/EGL/Loader.cpp @@ -167,6 +167,14 @@ static void* load_wrapper(const char* path) { return so; } +#ifndef EGL_WRAPPER_DIR +#if defined(__LP64__) +#define EGL_WRAPPER_DIR "/system/lib64" +#else +#define EGL_WRAPPER_DIR "/system/lib" +#endif +#endif + void* Loader::open(egl_connection_t* cnx) { void* dso; @@ -187,15 +195,10 @@ void* Loader::open(egl_connection_t* cnx) LOG_ALWAYS_FATAL_IF(!hnd, "couldn't find an OpenGL ES implementation"); -#if defined(__LP64__) - cnx->libEgl = load_wrapper("/system/lib64/libEGL.so"); - cnx->libGles2 = load_wrapper("/system/lib64/libGLESv2.so"); - cnx->libGles1 = load_wrapper("/system/lib64/libGLESv1_CM.so"); -#else - cnx->libEgl = load_wrapper("/system/lib/libEGL.so"); - cnx->libGles2 = load_wrapper("/system/lib/libGLESv2.so"); - cnx->libGles1 = load_wrapper("/system/lib/libGLESv1_CM.so"); -#endif + cnx->libEgl = load_wrapper(EGL_WRAPPER_DIR "/libEGL.so"); + cnx->libGles2 = load_wrapper(EGL_WRAPPER_DIR "/libGLESv2.so"); + cnx->libGles1 = load_wrapper(EGL_WRAPPER_DIR "/libGLESv1_CM.so"); + LOG_ALWAYS_FATAL_IF(!cnx->libEgl, "couldn't load system EGL wrapper libraries"); |