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

Commit 501c67c5 authored by Felipe Leme's avatar Felipe Leme Committed by android-build-merger
Browse files

Merge "Handled failure of execvp and increases am timeout." into nyc-dev

am: 9b02ecfe

* commit '9b02ecfe':
  Handled failure of execvp and increases am timeout.
parents 61be455e 9b02ecfe
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -198,6 +198,9 @@ static void dump_systrace() {
        // The drawback of calling execl directly is that we're not timing out if it hangs.
        MYLOGD("Running '/system/bin/atrace --async_dump', which can take several seconds");
        execl("/system/bin/atrace", "/system/bin/atrace", "--async_dump", nullptr);
        // execl should never return, but it doesn't hurt to handle that scenario
        MYLOGD("execl on '/system/bin/atrace --async_dump' returned control");
        _exit(-1);
    } else {
        close(pipefd[1]);  // close the write end of the pipe in the parent
        add_zip_entry_from_fd("systrace.txt", pipefd[0]); // write output to zip file
+3 −1
Original line number Diff line number Diff line
@@ -738,6 +738,8 @@ int run_command_always(const char *title, bool drop_root, int timeout_seconds, c

        execvp(command, (char**) args);
        // execvp's result will be handled after waitpid_with_timeout() below...
        MYLOGD("execvp on command %s (plus args) returned control; calling _exit(-1)", command)
        _exit(-1); // ...but it doesn't hurt to force exit, just in case
    }

    /* handle parent case */
@@ -849,7 +851,7 @@ void send_broadcast(const std::string& action, const std::vector<std::string>& a
    std::string args_string;
    format_args(am_index + 1, am_args, &args_string);
    MYLOGD("send_broadcast command: %s\n", args_string.c_str());
    run_command_always(NULL, 5, true, am_args);
    run_command_always(NULL, 20, true, am_args);
}

size_t num_props = 0;