diff src/callproc.c @ 20041:c743e52dd2b0

Ensure standard handles are reset even if spawnve fails.
author Andrew Innes <andrewi@gnu.org>
date Mon, 13 Oct 1997 18:11:44 +0000
parents 685d256c8cb5
children ad33fb40e5e7
line wrap: on
line diff
--- a/src/callproc.c	Mon Oct 13 18:06:22 1997 +0000
+++ b/src/callproc.c	Mon Oct 13 18:11:44 1997 +0000
@@ -1077,10 +1077,10 @@
 #ifdef WINDOWSNT
   /* Spawn the child.  (See ntproc.c:Spawnve).  */
   cpid = spawnve (_P_NOWAIT, new_argv[0], new_argv, env);
+  reset_standard_handles (in, out, err, handles);
   if (cpid == -1)
     /* An error occurred while trying to spawn the process.  */
     report_file_error ("Spawning child process", Qnil);
-  reset_standard_handles (in, out, err, handles);
   return cpid;
 #else /* not WINDOWSNT */
   /* execvp does not accept an environment arg so the only way