From cc5d388c53dc9a4ad8675cfc8a96096cfe563a4b Mon Sep 17 00:00:00 2001 From: Brian Nixon Date: Mon, 27 Mar 2023 15:22:52 +0100 Subject: [PATCH] Correct inheritance of stdout by child process on Windows --- samples/wrapper/wrapper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/wrapper/wrapper.cpp b/samples/wrapper/wrapper.cpp index 0d32a9a93e..03b18c9e93 100644 --- a/samples/wrapper/wrapper.cpp +++ b/samples/wrapper/wrapper.cpp @@ -778,7 +778,7 @@ int TASK::run(int argct, char** argvt) { boinc_resolve_filename_s(stdout_filename.c_str(), stdout_path); startup_info.hStdOutput = win_fopen(stdout_path.c_str(), "a"); } else { - startup_info.hStdOutput = (HANDLE)_get_osfhandle(_fileno(stderr)); + startup_info.hStdOutput = (HANDLE)_get_osfhandle(_fileno(stdout)); } if (stdin_filename != "") { boinc_resolve_filename_s(stdin_filename.c_str(), stdin_path);