Simplify process_wait()
The function process_wait() returned a bool (true if the process terminated successfully) and provided the exit code via an output parameter exit_code. But the returned value was always equivalent to exit_code == 0, so just return the exit code instead.
This commit is contained in:
@@ -8,8 +8,8 @@ process_check_success(process_t proc, const char *name) {
|
||||
LOGE("Could not execute \"%s\"", name);
|
||||
return false;
|
||||
}
|
||||
exit_code_t exit_code;
|
||||
if (!process_wait(proc, &exit_code)) {
|
||||
exit_code_t exit_code = process_wait(proc);
|
||||
if (exit_code) {
|
||||
if (exit_code != NO_EXIT_CODE) {
|
||||
LOGE("\"%s\" returned with value %" PRIexitcode, name, exit_code);
|
||||
} else {
|
||||
|
||||
@@ -47,12 +47,12 @@ bool
|
||||
process_terminate(process_t pid);
|
||||
|
||||
// wait and close the process (like waitpid())
|
||||
bool
|
||||
process_wait(process_t pid, exit_code_t *exit_code);
|
||||
exit_code_t
|
||||
process_wait(process_t pid);
|
||||
|
||||
// wait (but does not close) the process (waitid() with WNOWAIT)
|
||||
bool
|
||||
process_wait_noclose(process_t pid, exit_code_t *exit_code);
|
||||
exit_code_t
|
||||
process_wait_noclose(process_t pid);
|
||||
|
||||
// close the process
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user