From 0a07bac2e7d61143cf6353cad7e61d74347a0d68 Mon Sep 17 00:00:00 2001 From: Milo Turner Date: Wed, 19 Feb 2020 13:11:46 -0500 Subject: [PATCH] [util] fix msgq --- src/concurrent/msgq.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/concurrent/msgq.c b/src/concurrent/msgq.c index 3f94e8d..766ff51 100644 --- a/src/concurrent/msgq.c +++ b/src/concurrent/msgq.c @@ -44,8 +44,13 @@ void* msgq_recv1(struct msgq* mq, int* out_type) if (mq->head == NULL) { return NULL; } else { + int type = mq->head->type; void* pl = mq->head->payload; mq->head = mq->head->next; + + if (out_type != NULL) { + *out_type = type; + } return pl; } }