yutani: pex read() can return error code

This commit is contained in:
K. Lange 2022-08-21 19:01:05 +09:00
parent f84466b18f
commit abe66fb45b

View File

@ -120,10 +120,11 @@ yutani_msg_t * yutani_poll(yutani_t * y) {
return out;
}
size_t size;
ssize_t size;
{
char tmp[MAX_PACKET_SIZE];
size = pex_recv(y->sock, tmp);
if (size <= 0) return NULL;
out = malloc(size);
memcpy(out, tmp, size);
}