diff --git a/compat/mingw.c b/compat/mingw.c index b81057a3997ccb..b7a61d3455c86d 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -1655,6 +1655,9 @@ static pid_t mingw_spawnve_fd(const char *cmd, const char **argv, char **deltaen memset(&si, 0, sizeof(si)); si.StartupInfo.cb = sizeof(si); si.StartupInfo.hStdInput = winansi_get_osfhandle(fhin); + if (debug_1481) + warning("fhin: %d, hstdInput: %p", + fhin, si.StartupInfo.hStdInput); si.StartupInfo.hStdOutput = winansi_get_osfhandle(fhout); si.StartupInfo.hStdError = winansi_get_osfhandle(fherr); diff --git a/compat/winansi.c b/compat/winansi.c index efc0abcdac43e1..691aac2a444621 100644 --- a/compat/winansi.c +++ b/compat/winansi.c @@ -9,6 +9,8 @@ #include "win32.h" #include "win32/lazyload.h" +extern int debug_1481; + static int fd_is_interactive[3] = { 0, 0, 0 }; #define FD_CONSOLE 0x1 #define FD_SWAPPED 0x2 @@ -660,6 +662,11 @@ void winansi_init(void) */ HANDLE winansi_get_osfhandle(int fd) { + if (debug_1481) + warning("get_osf_handle for %d (fd_is_interactive %x %x): " + "%p (%p %p)", + fd, fd_is_interactive[1], fd_is_interactive[2], + (void *)_get_osfhandle(fd), hconsole1, hconsole2); if (fd == 1 && (fd_is_interactive[1] & FD_SWAPPED)) return hconsole1; if (fd == 2 && (fd_is_interactive[2] & FD_SWAPPED))