Check process success locally for adb commands

Remove sc_process_check_success() from the process API, it is too
specific.
This commit is contained in:
Romain Vimont
2021-11-25 09:37:53 +01:00
parent 680d2cc940
commit 904f0ae61e
5 changed files with 44 additions and 62 deletions

View File

@@ -9,25 +9,6 @@ sc_process_execute(const char *const argv[], sc_pid *pid) {
return sc_process_execute_p(argv, pid, NULL, NULL, NULL);
}
bool
sc_process_check_success(sc_pid pid, const char *name, bool close) {
if (pid == SC_PROCESS_NONE) {
LOGE("Could not execute \"%s\"", name);
return false;
}
sc_exit_code exit_code = sc_process_wait(pid, close);
if (exit_code) {
if (exit_code != SC_EXIT_CODE_NONE) {
LOGE("\"%s\" returned with value %" SC_PRIexitcode, name,
exit_code);
} else {
LOGE("\"%s\" exited unexpectedly", name);
}
return false;
}
return true;
}
ssize_t
sc_pipe_read_all(sc_pipe pipe, char *data, size_t len) {
size_t copied = 0;