Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 134a7193 authored by Josh Gao's avatar Josh Gao Committed by Gerrit Code Review
Browse files

Merge changes from topic 'kill_debuggerd'

* changes:
  dumpstate: use O_APPEND for anr file.
  dumpstate: switch to using libdebuggerd_client.
parents 0233bd47 989b812d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ LOCAL_SRC_FILES := dumpstate.cpp utils.cpp

LOCAL_MODULE := dumpstate

LOCAL_SHARED_LIBRARIES := libcutils liblog libselinux libbase libhardware_legacy
LOCAL_SHARED_LIBRARIES := libcutils libdebuggerd_client liblog libselinux libbase libhardware_legacy
# ZipArchive support, the order matters here to get all symbols.
LOCAL_STATIC_LIBRARIES := libziparchive libz libcrypto_static
LOCAL_HAL_STATIC_LIBRARIES := libdumpstate
+5 −3
Original line number Diff line number Diff line
@@ -40,9 +40,9 @@
#include <vector>

#include <android-base/file.h>
#include <cutils/debugger.h>
#include <cutils/properties.h>
#include <cutils/sockets.h>
#include <debuggerd/client.h>
#include <log/log.h>
#include <private/android_filesystem_config.h>

@@ -1021,7 +1021,9 @@ const char *dump_traces() {
    }

    /* 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,
    int fd = TEMP_FAILURE_RETRY(
        open(traces_path,
             O_CREAT | O_WRONLY | O_APPEND | O_TRUNC | O_NOFOLLOW | O_CLOEXEC,
             0666)); /* -rw-rw-rw- */
    if (fd < 0) {
        MYLOGE("%s: %s\n", traces_path, strerror(errno));