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

Commit a199fe11 authored by Greg Kaiser's avatar Greg Kaiser Committed by android-build-merger
Browse files

Merge "dumpstate: Properly handle unfound pid" am: 090d0e33 am: 41c7b3c9

am: 502758a4

Change-Id: Id546428e9d376d20984cc299c382fa3749c13d31
parents c84dbfab 502758a4
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -401,7 +401,7 @@ static void dump_dev_files(const char *title, const char *driverpath, const char
// 2. send a SIGUSR1 to its pid which will dump anrd's trace.
// 2. send a SIGUSR1 to its pid which will dump anrd's trace.
// 3. wait until the trace generation completes and add to the zip file.
// 3. wait until the trace generation completes and add to the zip file.
static bool dump_anrd_trace() {
static bool dump_anrd_trace() {
    unsigned int pid;
    int pid;
    char buf[50], path[PATH_MAX];
    char buf[50], path[PATH_MAX];
    struct dirent *trace;
    struct dirent *trace;
    struct stat st;
    struct stat st;
@@ -428,7 +428,7 @@ static bool dump_anrd_trace() {
        }
        }


        // send SIGUSR1 to the anrd to generate a trace.
        // send SIGUSR1 to the anrd to generate a trace.
        sprintf(buf, "%u", pid);
        sprintf(buf, "%d", pid);
        if (RunCommand("ANRD_DUMP", {"kill", "-SIGUSR1", buf},
        if (RunCommand("ANRD_DUMP", {"kill", "-SIGUSR1", buf},
                       CommandOptions::WithTimeout(1).Build())) {
                       CommandOptions::WithTimeout(1).Build())) {
            MYLOGE("anrd signal timed out. Please manually collect trace\n");
            MYLOGE("anrd signal timed out. Please manually collect trace\n");