summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/portable.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/portable.cpp b/src/portable.cpp
index 258c50f..7f6be6e 100644
--- a/src/portable.cpp
+++ b/src/portable.cpp
@@ -169,10 +169,16 @@ int portable_system(const char *command,const char *args,bool commandHasConsole)
else if (sInfo.hProcess) /* executable was launched, wait for it to finish */
{
WaitForSingleObject(sInfo.hProcess,INFINITE);
+ /* get process exit code */
+ DWORD exitCode;
+ if (!GetExitCodeProcess(sInfo.hProcess,&exitCode))
+ {
+ exitCode = -1;
+ }
CloseHandle(sInfo.hProcess);
+ return exitCode;
}
}
- return 0;
#endif
}