Skip to content

Commit

Permalink
fixup! mingw: spawned processes need to inherit only standard handles
Browse files Browse the repository at this point in the history
Let's preserve the correct errno (thanks, t0061!)

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Mar 7, 2018
1 parent b2faa49 commit 86f4c06
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions compat/mingw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1793,13 +1793,13 @@ 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) {
errno = err_win_to_posix(GetLastError());
warning("failed to restrict file handles (%ld)\n\n%s",
err, buf.buf);
}
strbuf_release(&buf);
}

if (!ret)
} else if (!ret)
errno = err_win_to_posix(GetLastError());

if (si.lpAttributeList)
Expand Down

0 comments on commit 86f4c06

Please sign in to comment.