summaryrefslogtreecommitdiff
path: root/gdbstub
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2020-06-05 20:46:15 +0200
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2020-06-05 20:46:15 +0200
commit4458c537ac243228097a5f43bc287b328dc76258 (patch)
treea8444a9ec2ace9128fb50f18591ed1f5d0afdb39 /gdbstub
parent90af55150f0cd8ca0967f6062207aa941494f0b5 (diff)
Make execI() wait until queue is initialized
Diffstat (limited to 'gdbstub')
-rw-r--r--gdbstub/gdbstub_sys.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/gdbstub/gdbstub_sys.c b/gdbstub/gdbstub_sys.c
index 7773de67..72aaa403 100644
--- a/gdbstub/gdbstub_sys.c
+++ b/gdbstub/gdbstub_sys.c
@@ -322,10 +322,15 @@ static void stop_thread(void)
#ifdef _POSIX_VERSION
void gdbstub_sys_recv(struct msg *msg)
{
- const ssize_t sz = mq_receive(out_queue, (char *)msg, sizeof *msg, 0);
+ while (out_queue <= 0)
+ ;
- if (sz < 0)
- perror("mq_receive");
+ {
+ const ssize_t sz = mq_receive(out_queue, (char *)msg, sizeof *msg, 0);
+
+ if (sz < 0)
+ perror("mq_receive");
+ }
}
#endif