Rename process_simple_wait to process_wait

Adding "simple" in the function name brings no benefit.
This commit is contained in:
Romain Vimont 2021-01-03 16:40:34 +01:00
parent cc6f5020d8
commit 821c175730
6 changed files with 7 additions and 7 deletions

View file

@ -179,7 +179,7 @@ file_handler_stop(struct file_handler *file_handler) {
if (!process_terminate(file_handler->current_process)) { if (!process_terminate(file_handler->current_process)) {
LOGW("Could not terminate install process"); LOGW("Could not terminate install process");
} }
process_simple_wait(file_handler->current_process, NULL); process_wait(file_handler->current_process, NULL);
file_handler->current_process = PROCESS_NONE; file_handler->current_process = PROCESS_NONE;
} }
mutex_unlock(file_handler->mutex); mutex_unlock(file_handler->mutex);

View file

@ -392,7 +392,7 @@ server_init(struct server *server) {
static int static int
run_wait_server(void *data) { run_wait_server(void *data) {
struct server *server = data; struct server *server = data;
process_simple_wait(server->process, NULL); // ignore exit code process_wait(server->process, NULL); // ignore exit code
mutex_lock(server->mutex); mutex_lock(server->mutex);
server->process_terminated = true; server->process_terminated = true;
@ -448,7 +448,7 @@ server_start(struct server *server, const char *serial,
SDL_CreateThread(run_wait_server, "wait-server", server); SDL_CreateThread(run_wait_server, "wait-server", server);
if (!server->wait_server_thread) { if (!server->wait_server_thread) {
process_terminate(server->process); process_terminate(server->process);
process_simple_wait(server->process, NULL); // ignore exit code process_wait(server->process, NULL); // ignore exit code
goto error2; goto error2;
} }

View file

@ -135,7 +135,7 @@ process_terminate(pid_t pid) {
} }
bool bool
process_simple_wait(pid_t pid, int *exit_code) { process_wait(pid_t pid, int *exit_code) {
int status; int status;
int code; int code;
if (waitpid(pid, &status, 0) == -1 || !WIFEXITED(status)) { if (waitpid(pid, &status, 0) == -1 || !WIFEXITED(status)) {

View file

@ -60,7 +60,7 @@ process_terminate(HANDLE handle) {
} }
bool bool
process_simple_wait(HANDLE handle, DWORD *exit_code) { process_wait(HANDLE handle, DWORD *exit_code) {
DWORD code; DWORD code;
if (WaitForSingleObject(handle, INFINITE) != WAIT_OBJECT_0 if (WaitForSingleObject(handle, INFINITE) != WAIT_OBJECT_0
|| !GetExitCodeProcess(handle, &code)) { || !GetExitCodeProcess(handle, &code)) {

View file

@ -9,7 +9,7 @@ process_check_success(process_t proc, const char *name) {
return false; return false;
} }
exit_code_t exit_code; exit_code_t exit_code;
if (!process_simple_wait(proc, &exit_code)) { if (!process_wait(proc, &exit_code)) {
if (exit_code != NO_EXIT_CODE) { if (exit_code != NO_EXIT_CODE) {
LOGE("\"%s\" returned with value %" PRIexitcode, name, exit_code); LOGE("\"%s\" returned with value %" PRIexitcode, name, exit_code);
} else { } else {

View file

@ -48,7 +48,7 @@ process_terminate(process_t pid);
// wait and close the process // wait and close the process
bool bool
process_simple_wait(process_t pid, exit_code_t *exit_code); process_wait(process_t pid, exit_code_t *exit_code);
// convenience function to wait for a successful process execution // convenience function to wait for a successful process execution
// automatically log process errors with the provided process name // automatically log process errors with the provided process name