all repos — mgba @ d09004cf0197ff8d8fd8aca6a949f35097def3d5

mGBA Game Boy Advance Emulator

Fix infinite listen errors
Jeffrey Pfau jeffrey@endrift.com
Sat, 01 Feb 2014 16:27:48 -0800
commit

d09004cf0197ff8d8fd8aca6a949f35097def3d5

parent

69d188668d45e21f71bea3f4694501b86716d628

1 files changed, 6 insertions(+), 0 deletions(-)

jump to
M src/debugger/gdb-stub.csrc/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) {