diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2020-12-30 23:54:49 +0100 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2020-12-30 23:54:49 +0100 |
| commit | 28b866b150243693179ce01e8306079b648f8794 (patch) | |
| tree | 05b6bc9941f79ec80e899258118bc90ca7710a22 /gdbstub | |
| parent | 364102c0b6eca37d9782a83f59b32ea0b98ffbae (diff) | |
Consider sockets less than zero as invalid
Diffstat (limited to 'gdbstub')
| -rw-r--r-- | gdbstub/gdbstub_sys.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/gdbstub/gdbstub_sys.c b/gdbstub/gdbstub_sys.c index c425100c..4b1d917a 100644 --- a/gdbstub/gdbstub_sys.c +++ b/gdbstub/gdbstub_sys.c @@ -367,9 +367,7 @@ static void stop_thread(void) #ifdef _POSIX_VERSION void gdbstub_sys_recv(struct msg *msg) { - while (out_queue < 0) - ; - + if (out_queue >= 0) { const ssize_t sz = mq_receive(out_queue, (char *)msg, sizeof *msg, 0); @@ -406,7 +404,7 @@ void dbg_stop(void) void dbg_start(void) { - if (server_socket > 0) { + if (server_socket >= 0) { fprintf(stderr, "gdb server already started\n"); return; } @@ -415,7 +413,7 @@ void dbg_start(void) server_socket = StartServer(port); - if (server_socket > 0) { + if (server_socket >= 0) { printf("GDB server started on port %hu.\n", port); if (queue_create()) fprintf(stderr, "could not create gdb stub internal queues\n"); |
