janneke pushed a commit to branch wip-mingw
in repository guile.
commit ecb487089705a127ffcfc7e47637aa638f6a014e
Author: Jan (janneke) Nieuwenhuizen <[email protected]>
AuthorDate: Wed Apr 1 18:03:09 2020 +0200
Clear errno before CreateProcess for MinGW.
* libguile/posix-w32.c (start_child): Avoid recursing (and breaking any
PIPE setup) when running in WINE.
---
libguile/posix-w32.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libguile/posix-w32.c b/libguile/posix-w32.c
index f11c526..0f0b350 100644
--- a/libguile/posix-w32.c
+++ b/libguile/posix-w32.c
@@ -683,6 +683,10 @@ start_child (const char *exec_file, char **argv,
cmdline = prepare_cmdline (exec_file, (const char * const *)argv,
bin_sh_replaced);
+ /* When running in WINE, chances are we hit ENOENT (possibly
+ translated to ENOEXEC). */
+ errno = 0;
+
/* All set and ready to fly. Launch the child process. */
if (!CreateProcess (progfile, cmdline, NULL, NULL, TRUE, 0, env_block, NULL,
&si, &pi))