Split command into process and adb

The process API provides the system-specific implementation, the adb API
uses it to expose adb commands.
This commit is contained in:
Romain Vimont
2021-01-03 14:55:15 +01:00
parent aa8b571389
commit 4bd9da4c93
12 changed files with 97 additions and 80 deletions

View File

@@ -1,4 +1,4 @@
#include "command.h"
#include "util/process.h"
#include <sys/stat.h>
@@ -21,7 +21,7 @@ build_cmd(char *cmd, size_t len, const char *const argv[]) {
}
enum process_result
cmd_execute(const char *const argv[], HANDLE *handle) {
process_execute(const char *const argv[], HANDLE *handle) {
STARTUPINFOW si;
PROCESS_INFORMATION pi;
memset(&si, 0, sizeof(si));
@@ -55,12 +55,12 @@ cmd_execute(const char *const argv[], HANDLE *handle) {
}
bool
cmd_terminate(HANDLE handle) {
process_terminate(HANDLE handle) {
return TerminateProcess(handle, 1);
}
bool
cmd_simple_wait(HANDLE handle, DWORD *exit_code) {
process_simple_wait(HANDLE handle, DWORD *exit_code) {
DWORD code;
if (WaitForSingleObject(handle, INFINITE) != WAIT_OBJECT_0
|| !GetExitCodeProcess(handle, &code)) {