summaryrefslogtreecommitdiff
path: root/w32/subproc/sub_proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'w32/subproc/sub_proc.c')
-rw-r--r--w32/subproc/sub_proc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/w32/subproc/sub_proc.c b/w32/subproc/sub_proc.c
index 52f2fa2..bf1e732 100644
--- a/w32/subproc/sub_proc.c
+++ b/w32/subproc/sub_proc.c
@@ -1193,6 +1193,9 @@ process_easy(
if (process_begin(hProcess, argv, envp, argv[0], NULL)) {
fake_exits_pending++;
+ /* process_begin() failed: make a note of that. */
+ if (!((sub_process*) hProcess)->last_err)
+ ((sub_process*) hProcess)->last_err = -1;
((sub_process*) hProcess)->exit_code = process_last_err(hProcess);
/* close up unused handles */