From 246ad5d80dcd14385e1cfd3cabbe7ec529b90de5 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sun, 21 Dec 2025 20:53:07 +0100 Subject: [PATCH] fix: Forwarder not correctly returning return code on Windows (cherry picked from commit 4e628826c3a92bfd59d3fbcec580d87745f7f4a4) --- main/forwarder/source/main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main/forwarder/source/main.cpp b/main/forwarder/source/main.cpp index 909ac8a68..b5f6bf349 100644 --- a/main/forwarder/source/main.cpp +++ b/main/forwarder/source/main.cpp @@ -131,7 +131,12 @@ int launchExecutable() { ::CloseHandle(pi.hThread); ::CloseHandle(hChildStdoutRead); - return EXIT_SUCCESS; + DWORD exitCode = 0; + if (::GetExitCodeProcess(pi.hProcess, &exitCode)) { + return static_cast(exitCode); + } else { + return EXIT_FAILURE; + } } int main() {