From e0b1d2a20497871f6c61a76c26546cb4f68e2c6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Mon, 21 Nov 2016 20:33:57 -0800 Subject: [PATCH] Added process reader/writer exit code. --- include/bx/crtimpl.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/include/bx/crtimpl.h b/include/bx/crtimpl.h index e26f195..eeea794 100644 --- a/include/bx/crtimpl.h +++ b/include/bx/crtimpl.h @@ -256,7 +256,7 @@ namespace bx virtual void close() BX_OVERRIDE { BX_CHECK(NULL != m_file, "Process not open!"); - pclose(m_file); + m_exitCode = pclose(m_file); m_file = NULL; } @@ -282,8 +282,14 @@ namespace bx return size; } + int32_t getExitCode() const + { + return m_exitCode; + } + private: FILE* m_file; + int32_t m_exitCode; }; class ProcessWriter : public WriterOpenI, public CloserI, public WriterI @@ -316,7 +322,7 @@ namespace bx virtual void close() BX_OVERRIDE { BX_CHECK(NULL != m_file, "Process not open!"); - pclose(m_file); + m_exitCode = pclose(m_file); m_file = NULL; } @@ -338,8 +344,14 @@ namespace bx return size; } + int32_t getExitCode() const + { + return m_exitCode; + } + private: FILE* m_file; + int32_t m_exitCode; }; #endif // BX_CONFIG_CRT_PROCESS