aboutsummaryrefslogtreecommitdiff
path: root/gdbstub.c
diff options
context:
space:
mode:
authoredgar_igl <edgar_igl@c046a42c-6fe2-441c-8c8c-71466251a162>2009-01-07 10:22:28 +0000
committeredgar_igl <edgar_igl@c046a42c-6fe2-441c-8c8c-71466251a162>2009-01-07 10:22:28 +0000
commit9f6164d6f635e4eead4a8b90ed40650108c9f303 (patch)
tree79bc6ed45ec120124efadb9cbbbdcd167c64fb04 /gdbstub.c
parent6cdc737502a38eb41747de2e1ff72a6aa1afa1b5 (diff)
gdbstub: fix gdbserver_fork
As reported by Martin Mohring fork doesn't work with NPTL. A fix is attached that makes the also attached test run (tested with ARM CodeSourcery 2008q3 on an x86_64 Fedora Core with kernel 2.6.23). Signed-off-by: Laurent Desnogues <laurent.desnogues@gmail.com> Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6195 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'gdbstub.c')
-rw-r--r--gdbstub.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdbstub.c b/gdbstub.c
index 6c6a7aa63e..b8198ee29f 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -2225,7 +2225,7 @@ int gdbserver_start(int port)
void gdbserver_fork(CPUState *env)
{
GDBState *s = gdbserver_state;
- if (s->fd < 0)
+ if (gdbserver_fd < 0 || s->fd < 0)
return;
close(s->fd);
s->fd = -1;