From fc5326d2c5719a1542002b610e75960cb8fe7656 Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Mon, 20 Mar 2006 04:05:24 +0000 Subject: [PATCH] * gdb/ser-mingw.c (free_pipe_state): Close pipe before calling pex_free. --- gdb/ser-mingw.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gdb/ser-mingw.c b/gdb/ser-mingw.c index 5d0c0733b57..b5cd16eb26c 100644 --- a/gdb/ser-mingw.c +++ b/gdb/ser-mingw.c @@ -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); -- 2.47.2