summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2020-10-26 23:07:07 +0100
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2020-10-26 23:07:07 +0100
commit4006528c1a7877977ef3d14d322420471235f542 (patch)
tree80f2770d9c194547bc133998cebeb495e6d61e7c
parent76b11a3252e536b8fde5b895a36ae73c6042d4e1 (diff)
Set sockets to invalid value on init
-rw-r--r--gdbstub/gdbstub_sys.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gdbstub/gdbstub_sys.c b/gdbstub/gdbstub_sys.c
index ca8dd2db..ef81bd2d 100644
--- a/gdbstub/gdbstub_sys.c
+++ b/gdbstub/gdbstub_sys.c
@@ -14,10 +14,10 @@
#include <errno.h>
static pthread_t thread;
-static mqd_t in_queue, out_queue;
+static mqd_t in_queue = -1, out_queue = -1;
#endif
-static int server_socket, client_socket;
+static int server_socket = -1, client_socket = -1;
static enum {
PAUSED,
} state;
@@ -336,7 +336,7 @@ static void stop_thread(void)
#ifdef _POSIX_VERSION
void gdbstub_sys_recv(struct msg *msg)
{
- while (out_queue <= 0)
+ while (out_queue < 0)
;
{