aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;