]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* gdb/ser-mingw.c (free_pipe_state): Close pipe before calling
authorMark Mitchell <mark@codesourcery.com>
Mon, 20 Mar 2006 04:05:24 +0000 (04:05 +0000)
committerMark Mitchell <mark@codesourcery.com>
Mon, 20 Mar 2006 04:05:24 +0000 (04:05 +0000)
pex_free.

gdb/ser-mingw.c

index 5d0c0733b5766f27fe15f1b3f1f8bd124aedc6d3..b5cd16eb26c2b1d44b3f176bd4e470d6e4707191 100644 (file)
@@ -616,10 +616,13 @@ free_pipe_state (struct pipe_state *ps)
   if (ps->wait.stop_select != INVALID_HANDLE_VALUE)
     SetEvent (ps->wait.stop_select);
 
-  if (ps->pex)
-    pex_free (ps->pex);
+  /* Close the pipe to the child.  We must close the pipe before
+     calling pex_free because pex_free will wait for the child to exit
+     and the child will not exit until the pipe is closed.  */
   if (ps->input)
     fclose (ps->input);
+  if (ps->pex)
+    pex_free (ps->pex);
   /* pex_free closes ps->output.  */
 
   xfree (ps);