--- a/posixwin.scm +++ b/posixwin.scm @@ -386,10 +386,15 @@ { if (f_share_io[i]) { + /* bInheritHandle is independent of DUPLICATE_SAME_ACCESS. + STARTF_USESTDHANDLES needs an inheritable duplicate; + FALSE fails CreateProcess with ERROR_INVALID_HANDLE + when stderr is not a console. Not the SetHandleInformation + pass removed for ticket 765. */ success = DuplicateHandle( cur_process, standard_io_handles[i], cur_process, &child_io_handles[i], - 0, FALSE, DUPLICATE_SAME_ACCESS); + 0, TRUE, DUPLICATE_SAME_ACCESS); } else { --- a/posixwin.c +++ b/posixwin.c @@ -458,10 +458,15 @@ { if (f_share_io[i]) { + /* bInheritHandle is independent of DUPLICATE_SAME_ACCESS. + STARTF_USESTDHANDLES needs an inheritable duplicate; + FALSE fails CreateProcess with ERROR_INVALID_HANDLE + when stderr is not a console. Not the SetHandleInformation + pass removed for ticket 765. */ success = DuplicateHandle( cur_process, standard_io_handles[i], cur_process, &child_io_handles[i], - 0, FALSE, DUPLICATE_SAME_ACCESS); + 0, TRUE, DUPLICATE_SAME_ACCESS); } else {