Print an error message for process creation failures on windows

This commit is contained in:
baldurk
2022-01-31 12:02:26 +00:00
parent 4f6d6d9c7f
commit 6ca3d00f25
+3 -1
View File
@@ -546,6 +546,8 @@ static PROCESS_INFORMATION RunProcess(const rdcstr &app, const rdcstr &workingDi
envString.empty() ? NULL : (void *)envString.data(),
workdir.c_str(), &si, &pi);
DWORD err = GetLastError();
if(phChildStdOutput_Rd)
{
CloseHandle(hChildStdOutput_Wr);
@@ -557,7 +559,7 @@ static PROCESS_INFORMATION RunProcess(const rdcstr &app, const rdcstr &workingDi
if(!retValue)
{
if(!internal)
RDCWARN("Process %s could not be loaded.", app.c_str());
RDCWARN("Process %s could not be loaded (error %d).", app.c_str(), err);
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
RDCEraseEl(pi);