Browse Source

Merge branch 'master' of github.com:bkaradzic/bx

Branimir Karadžić 9 years ago
parent
commit
282a2ce91c
1 changed files with 14 additions and 2 deletions
  1. 14 2
      include/bx/crtimpl.h

+ 14 - 2
include/bx/crtimpl.h

@@ -256,7 +256,7 @@ namespace bx
 		virtual void close() BX_OVERRIDE
 		virtual void close() BX_OVERRIDE
 		{
 		{
 			BX_CHECK(NULL != m_file, "Process not open!");
 			BX_CHECK(NULL != m_file, "Process not open!");
-			pclose(m_file);
+			m_exitCode = pclose(m_file);
 			m_file = NULL;
 			m_file = NULL;
 		}
 		}
 
 
@@ -282,8 +282,14 @@ namespace bx
 			return size;
 			return size;
 		}
 		}
 
 
+		int32_t getExitCode() const
+		{
+			return m_exitCode;
+		}
+
 	private:
 	private:
 		FILE* m_file;
 		FILE* m_file;
+		int32_t m_exitCode;
 	};
 	};
 
 
 	class ProcessWriter : public WriterOpenI, public CloserI, public WriterI
 	class ProcessWriter : public WriterOpenI, public CloserI, public WriterI
@@ -316,7 +322,7 @@ namespace bx
 		virtual void close() BX_OVERRIDE
 		virtual void close() BX_OVERRIDE
 		{
 		{
 			BX_CHECK(NULL != m_file, "Process not open!");
 			BX_CHECK(NULL != m_file, "Process not open!");
-			pclose(m_file);
+			m_exitCode = pclose(m_file);
 			m_file = NULL;
 			m_file = NULL;
 		}
 		}
 
 
@@ -338,8 +344,14 @@ namespace bx
 			return size;
 			return size;
 		}
 		}
 
 
+		int32_t getExitCode() const
+		{
+			return m_exitCode;
+		}
+
 	private:
 	private:
 		FILE* m_file;
 		FILE* m_file;
+		int32_t m_exitCode;
 	};
 	};
 
 
 #endif // BX_CONFIG_CRT_PROCESS
 #endif // BX_CONFIG_CRT_PROCESS