OSDN Git Service

Handled failure of execvp and increases am timeout.
authorFelipe Leme <felipeal@google.com>
Wed, 23 Mar 2016 16:50:11 +0000 (09:50 -0700)
committerThe Android Automerger <android-build@google.com>
Wed, 23 Mar 2016 18:06:29 +0000 (11:06 -0700)
commitb46c7f98359ef83eb4345814235f951f68eb477d
treee7bd1ddc9f0138e86ecc43a29ce43a5b2e1d1c12
parentdd64018a8797e7b788f1e2aea7ce1d395f20ce36
Handled failure of execvp and increases am timeout.

The run_command_always() call fork and runs the command in the child
code, and user to have the above logic:

    if (pid == 0) {
        // boiling code
        execvp(command, (char**) args);
        // execvp's result will be handled after waitpid_with_timeout() below...
        _exit(-1); // ...but it doesn't hurt to force exit, just in case
    }

Recently, the _exit(-1) line was removed and there's been reports of
dumpstate hanging after, because it tries to wait for pid 0 to
finish (and in some cases it even tries to kill it).

Also increased the timeout when running am to send broadcasts.

BUG: 27804637
BUG: 27809534
Change-Id: Ia129253e367e5886d305947e56a643fd660a33bd
cmds/dumpstate/dumpstate.cpp
cmds/dumpstate/utils.cpp