This commit is contained in:
yuchenlin 2018-09-08 01:24:33 +00:00 committed by GitHub
commit e6633f3b12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View file

@ -319,5 +319,10 @@ int main(int argc, char *argv[]) {
avformat_network_deinit(); // ignore failure
#if defined (__WINDOWS__) && ! defined (WINDOWS_NOCONSOLE)
if (res != 0) {
system("pause");
}
#endif
return res;
}

View file

@ -29,7 +29,11 @@ enum process_result cmd_execute(const char *path, const char *const argv[], HAND
#endif
if (!CreateProcess(NULL, cmd, NULL, NULL, FALSE, flags, NULL, NULL, &si, &pi)) {
*handle = NULL;
return PROCESS_ERROR_GENERIC;
if (GetLastError() == ERROR_FILE_NOT_FOUND) {
return PROCESS_ERROR_MISSING_BINARY;
} else {
return PROCESS_ERROR_GENERIC;
}
}
*handle = pi.hProcess;