From f2a677fb4d2fc61cabe6a64c5d23d522647579fc Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Fri, 23 Mar 2018 23:38:07 +0100 Subject: [PATCH] fixup! mingw: spawned processes need to inherit only standard handles When we suppress the warning that we could not restrict file handle inheritance because of known error conditions, we should really suppress the *entire* warning, not just parts of it. This was reported in https://github.com/git-for-windows/git/issues/1578#issuecomment-375692983 Signed-off-by: Johannes Schindelin --- compat/mingw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compat/mingw.c b/compat/mingw.c index 7503e5c291..0b86861a96 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -1793,7 +1793,7 @@ static pid_t mingw_spawnve_fd(const char *cmd, const char **argv, char **deltaen ret = CreateProcessW(*wcmd ? wcmd : NULL, wargs, NULL, NULL, TRUE, flags, wenvblk, dir ? wdir : NULL, &si.StartupInfo, &pi); - if (ret) { + if (ret && buf.len) { errno = err_win_to_posix(GetLastError()); warning("failed to restrict file handles (%ld)\n\n%s", err, buf.buf);