mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-12-21 23:44:20 +01:00
The process API provides the system-specific implementation, the adb API uses it to expose adb commands.
22 lines
536 B
C
22 lines
536 B
C
#include "process.h"
|
|
|
|
#include "log.h"
|
|
|
|
bool
|
|
process_check_success(process_t proc, const char *name) {
|
|
if (proc == PROCESS_NONE) {
|
|
LOGE("Could not execute \"%s\"", name);
|
|
return false;
|
|
}
|
|
exit_code_t exit_code;
|
|
if (!process_simple_wait(proc, &exit_code)) {
|
|
if (exit_code != NO_EXIT_CODE) {
|
|
LOGE("\"%s\" returned with value %" PRIexitcode, name, exit_code);
|
|
} else {
|
|
LOGE("\"%s\" exited unexpectedly", name);
|
|
}
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|