Skip to content

Commit 063b0e7

Browse files
committed
mingw: provide even more verbose debug output to diagnose issue 1481
Something about those handles must be something that Windows does not like to be provided in the list of handles-to-inherit. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 981dfb1 commit 063b0e7

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

compat/mingw.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1758,7 +1758,21 @@ static pid_t mingw_spawnve_fd(const char *cmd, const char **argv, char **deltaen
17581758
*/
17591759
if (!ret && restrict_handle_inheritance && stdhandles_count) {
17601760
DWORD err = GetLastError();
1761-
if (debug_1481) warning("error: %d", (int)err);
1761+
if (debug_1481) {
1762+
int ii;
1763+
1764+
error("error: %d", (int)err);
1765+
error("#stdhandles: %d", (int)stdhandles_count);
1766+
for (ii = 0; ii < stdhandles_count; ii++) {
1767+
DWORD fl;
1768+
error("handle #%d: %p (file type %x, get handle"
1769+
" info %d: %x)", ii, stdhandles[ii],
1770+
(int)GetFileType(stdhandles[ii]),
1771+
(int)GetHandleInformation(stdhandles[ii],
1772+
&fl),
1773+
(int)fl);
1774+
}
1775+
}
17621776
if (err == ERROR_NO_SYSTEM_RESOURCES ||
17631777
err == ERROR_INVALID_HANDLE || debug_1481) {
17641778
restrict_handle_inheritance = 0;

0 commit comments

Comments
 (0)