Expose a single process_wait()

There were two versions: process_wait() and process_wait_noclose().

Expose a single version with a flag (it was already implemented that way
internally).
This commit is contained in:
Romain Vimont
2021-01-22 18:48:17 +01:00
parent b8edcf52b0
commit 6a50231698
6 changed files with 13 additions and 35 deletions

View File

@@ -8,7 +8,7 @@ process_check_success(process_t proc, const char *name) {
LOGE("Could not execute \"%s\"", name);
return false;
}
exit_code_t exit_code = process_wait(proc);
exit_code_t exit_code = process_wait(proc, true);
if (exit_code) {
if (exit_code != NO_EXIT_CODE) {
LOGE("\"%s\" returned with value %" PRIexitcode, name, exit_code);

View File

@@ -47,16 +47,14 @@ bool
process_terminate(process_t pid);
// wait and close the process (like waitpid())
// the "close" flag indicates if the process must be "closed" (reaped)
// (passing false is equivalent to enable WNOWAIT in waitid())
exit_code_t
process_wait(process_t pid);
// wait (but does not close) the process (waitid() with WNOWAIT)
exit_code_t
process_wait_noclose(process_t pid);
process_wait(process_t pid, bool close);
// close the process
//
// Semantically, process_wait = process_wait_noclose + process_close.
// Semantically, process_wait(close) = process_wait(noclose) + process_close
void
process_close(process_t pid);