summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--overlay/mgdb/gdb/winnt-nat.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/overlay/mgdb/gdb/winnt-nat.c b/overlay/mgdb/gdb/winnt-nat.c
index 71d279b..cdfa210 100644
--- a/overlay/mgdb/gdb/winnt-nat.c
+++ b/overlay/mgdb/gdb/winnt-nat.c
@@ -158,12 +158,14 @@ static void winnt_attach (struct target_ops * t, const char * args, int from_tty
if (__dbg_rbreak(pfd) < 0) {
__dbg_detach(pfd);
+ close(pfd);
winnt_perror ("could not issue a breakpoint in process",pid);
}
if (winnt_plist_add(pid,pfd) < 0) {
__dbg_detach(pfd);
+ close(pfd);
winnt_error ("could not expand debuggee list");
}
}
@@ -182,6 +184,9 @@ static void winnt_detach (struct target_ops * t, const char * args, int from_tty
if (__dbg_detach(pfd) < 0)
winnt_perror ("could not attach from process",pid);
+ if (close(pfd) < 0)
+ winnt_perror ("failed to close process file descriptor",pid);
+
winnt_plist_remove(pid);
x86_cleanup_dregs();