diff options
author | 2016-03-24 00:04:14 +0000 | |
---|---|---|
committer | 2016-03-24 00:04:14 +0000 | |
commit | 8e48e0aadae765b4ed104890ca33db32ea347a8a (patch) | |
tree | c9ac6ae5e4daab4faca68300a284c0e75ad316f8 /cmds/dumpstate/utils.cpp | |
parent | 7bd290578888ae572e95e800357a64573b23f385 (diff) | |
parent | 73f731c30a8b7d811127b8e89e01c427b6aab622 (diff) |
Merge "Fixed send_broadcast and fork handling issues." into nyc-dev
Diffstat (limited to 'cmds/dumpstate/utils.cpp')
-rw-r--r-- | cmds/dumpstate/utils.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cmds/dumpstate/utils.cpp b/cmds/dumpstate/utils.cpp index 3fa2141cf1..975cd27b87 100644 --- a/cmds/dumpstate/utils.cpp +++ b/cmds/dumpstate/utils.cpp @@ -723,7 +723,7 @@ int run_command_always(const char *title, bool drop_root, int timeout_seconds, c if (pid == 0) { if (drop_root && !drop_root_user()) { printf("*** could not drop root before running %s: %s\n", command, strerror(errno)); - _exit(-1); + return -1; } /* make sure the child dies when dumpstate dies */ @@ -739,7 +739,7 @@ int run_command_always(const char *title, bool drop_root, int timeout_seconds, c // execvp's result will be handled after waitpid_with_timeout() below... MYLOGD("execvp on command %s returned control (error: %s)", command, strerror(errno)); fflush(stdout); - _exit(-1); // ...but it doesn't hurt to force exit, just in case + return -1; // ...but it doesn't hurt to force exit, just in case } /* handle parent case */ @@ -851,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, 20, true, am_args); + run_command_always(NULL, true, 20, am_args); } size_t num_props = 0; |