From 579bfe97df8f9773764b0a332390e65a646a35b0 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Sun, 8 Jul 2018 14:22:40 -0400 Subject: [PATCH] Add status code to os.execute for windows. --- src/core/os.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/os.c b/src/core/os.c index b7582208..02ccf30f 100644 --- a/src/core/os.c +++ b/src/core/os.c @@ -91,10 +91,12 @@ static int os_execute(DstArgs args) { // Wait until child process exits. WaitForSingleObject(pi.hProcess, INFINITE); - // Close process and thread handles. + // Close process and thread handles. + WORD status; + GetExitCodeProcess(pi.hProcess, &status); CloseHandle(pi.hProcess); CloseHandle(pi.hThread); - DST_RETURN_INTEGER(args, 0); + DST_RETURN_INTEGER(args, (int32_t)status); } #else static int os_execute(DstArgs args) {