2021-01-03 21:55:15 +08:00
|
|
|
#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;
|
2021-01-03 23:40:34 +08:00
|
|
|
if (!process_wait(proc, &exit_code)) {
|
2021-01-03 21:55:15 +08:00
|
|
|
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;
|
|
|
|
}
|