Factorize common impl of process_execute()

Both implementations are the same. Move them to the common process.c.
This commit is contained in:
Romain Vimont 2021-11-11 17:49:47 +01:00
parent e80e6631e4
commit 7e93abcf6d
3 changed files with 5 additions and 10 deletions

View file

@ -153,11 +153,6 @@ process_execute_redirect(const char *const argv[], pid_t *pid, int *pipe_stdin,
return res; return res;
} }
enum process_result
process_execute(const char *const argv[], pid_t *pid) {
return process_execute_redirect(argv, pid, NULL, NULL, NULL);
}
bool bool
process_terminate(pid_t pid) { process_terminate(pid_t pid) {
if (pid <= 0) { if (pid <= 0) {

View file

@ -142,11 +142,6 @@ error_close_stdin:
return ret; return ret;
} }
enum process_result
process_execute(const char *const argv[], HANDLE *handle) {
return process_execute_redirect(argv, handle, NULL, NULL, NULL);
}
bool bool
process_terminate(HANDLE handle) { process_terminate(HANDLE handle) {
return TerminateProcess(handle, 1); return TerminateProcess(handle, 1);

View file

@ -3,6 +3,11 @@
#include <libgen.h> #include <libgen.h>
#include "log.h" #include "log.h"
enum process_result
process_execute(const char *const argv[], process_t *pid) {
return process_execute_redirect(argv, pid, NULL, NULL, NULL);
}
bool bool
process_check_success(process_t proc, const char *name, bool close) { process_check_success(process_t proc, const char *name, bool close) {
if (proc == PROCESS_NONE) { if (proc == PROCESS_NONE) {