diff options
Diffstat (limited to 'src/zencore')
| -rw-r--r-- | src/zencore/include/zencore/process.h | 1 | ||||
| -rw-r--r-- | src/zencore/process.cpp | 11 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/zencore/include/zencore/process.h b/src/zencore/include/zencore/process.h index dbf5837e2..48a2eb0d7 100644 --- a/src/zencore/include/zencore/process.h +++ b/src/zencore/include/zencore/process.h @@ -28,6 +28,7 @@ public: ZENCORE_API [[nodiscard]] bool IsValid() const; ZENCORE_API bool Wait(int TimeoutMs = -1); ZENCORE_API int WaitExitCode(); + ZENCORE_API int GetExitCode(); ZENCORE_API bool Terminate(int ExitCode); ZENCORE_API void Reset(); [[nodiscard]] inline int Pid() const { return m_Pid; } diff --git a/src/zencore/process.cpp b/src/zencore/process.cpp index 8fddc9562..88eb8af0d 100644 --- a/src/zencore/process.cpp +++ b/src/zencore/process.cpp @@ -277,10 +277,8 @@ ProcessHandle::Wait(int TimeoutMs) } int -ProcessHandle::WaitExitCode() +ProcessHandle::GetExitCode() { - Wait(-1); - #if ZEN_PLATFORM_WINDOWS DWORD ExitCode = 0; GetExitCodeProcess(m_ProcessHandle, &ExitCode); @@ -297,6 +295,13 @@ ProcessHandle::WaitExitCode() #endif } +int +ProcessHandle::WaitExitCode() +{ + Wait(-1); + return GetExitCode(); +} + ////////////////////////////////////////////////////////////////////////// #if !ZEN_PLATFORM_WINDOWS || ZEN_WITH_TESTS |