main: Check for error in msgrcv

pull/1290/head
Joshua Ashton 2 months ago committed by flightlessmango
parent 7c7cb9a1dc
commit baa06da2ad

@ -162,7 +162,9 @@ static void msg_read_thread(){
while (1){
// make sure that the message recieved is compatible
// and that we're not trying to use variables that don't exist (yet)
size_t msg_size = msgrcv(msgid, (void *) raw_msg, sizeof(raw_msg), 1, 0) + sizeof(long);
size_t msg_size = msgrcv(msgid, (void *) raw_msg, sizeof(raw_msg), 1, 0);
if (msg_size != -1)
{
if (hdr->version == 1){
if (msg_size > offsetof(struct mangoapp_msg_v1, visible_frametime_ns)){
bool should_new_frame = false;
@ -214,6 +216,11 @@ static void msg_read_thread(){
exit(1);
}
}
else
{
printf("mangoapp: msgrcv returned -1 with error %d - %s\n", errno, strerror(errno));
}
}
}
static const char *GamescopeOverlayProperty = "GAMESCOPE_EXTERNAL_OVERLAY";

Loading…
Cancel
Save