From 9f6164d6f635e4eead4a8b90ed40650108c9f303 Mon Sep 17 00:00:00 2001 From: edgar_igl Date: Wed, 7 Jan 2009 10:22:28 +0000 Subject: [PATCH] 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 Acked-by: Edgar E. Iglesias git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6195 c046a42c-6fe2-441c-8c8c-71466251a162 --- gdbstub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;