Commit 9f6164d6f635e4eead4a8b90ed40650108c9f303

Authored by edgar_igl
1 parent 6cdc7375

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
Showing 1 changed file with 1 additions and 1 deletions
gdbstub.c
... ... @@ -2225,7 +2225,7 @@ int gdbserver_start(int port)
2225 2225 void gdbserver_fork(CPUState *env)
2226 2226 {
2227 2227 GDBState *s = gdbserver_state;
2228   - if (s->fd < 0)
  2228 + if (gdbserver_fd < 0 || s->fd < 0)
2229 2229 return;
2230 2230 close(s->fd);
2231 2231 s->fd = -1;
... ...