Skip to content

Commit 0922cb3

Browse files
committed
mingw: try to figure out where TortoiseGit's (HANDLE)-2 comes from
It was reported that TortoiseGit passes in an stdin (HANDLE)-2 in git-for-windows#1481 (comment). Let's figure out where that comes from. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 9ca726a commit 0922cb3

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

compat/mingw.c

+3
Original file line numberDiff line numberDiff line change
@@ -1655,6 +1655,9 @@ static pid_t mingw_spawnve_fd(const char *cmd, const char **argv, char **deltaen
16551655
memset(&si, 0, sizeof(si));
16561656
si.StartupInfo.cb = sizeof(si);
16571657
si.StartupInfo.hStdInput = winansi_get_osfhandle(fhin);
1658+
if (debug_1481)
1659+
warning("fhin: %d, hstdInput: %p",
1660+
fhin, si.StartupInfo.hStdInput);
16581661
si.StartupInfo.hStdOutput = winansi_get_osfhandle(fhout);
16591662
si.StartupInfo.hStdError = winansi_get_osfhandle(fherr);
16601663

compat/winansi.c

+7
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#include "win32.h"
1010
#include "win32/lazyload.h"
1111

12+
extern int debug_1481;
13+
1214
static int fd_is_interactive[3] = { 0, 0, 0 };
1315
#define FD_CONSOLE 0x1
1416
#define FD_SWAPPED 0x2
@@ -660,6 +662,11 @@ void winansi_init(void)
660662
*/
661663
HANDLE winansi_get_osfhandle(int fd)
662664
{
665+
if (debug_1481)
666+
warning("get_osf_handle for %d (fd_is_interactive %x %x): "
667+
"%p (%p %p)",
668+
fd, fd_is_interactive[1], fd_is_interactive[2],
669+
(void *)_get_osfhandle(fd), hconsole1, hconsole2);
663670
if (fd == 1 && (fd_is_interactive[1] & FD_SWAPPED))
664671
return hconsole1;
665672
if (fd == 2 && (fd_is_interactive[2] & FD_SWAPPED))

0 commit comments

Comments
 (0)