Fix infinite listen errors
Jeffrey Pfau jeffrey@endrift.com
Sat, 01 Feb 2014 16:27:48 -0800
1 files changed,
6 insertions(+),
0 deletions(-)
jump to
M
src/debugger/gdb-stub.c
→
src/debugger/gdb-stub.c
@@ -477,6 +477,9 @@
return 1; cleanup: + if (stub->d.log) { + stub->d.log(&stub->d, DEBUGGER_LOG_ERROR, "Couldn't listen on port"); + } close(stub->socket); stub->socket = -1; return 0;@@ -501,6 +504,9 @@ }
} void GDBStubUpdate(struct GDBStub* stub) { + if (stub->socket == -1) { + return; + } if (stub->connection == -1) { stub->connection = accept(stub->socket, 0, 0); if (stub->connection >= 0) {