mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2024-11-22 07:02:28 +00:00
Assert read return value in examples/input-method
This commit is contained in:
parent
4c28745c95
commit
b99da405e7
@ -1,4 +1,5 @@
|
||||
#define _POSIX_C_SOURCE 200809L
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@ -390,7 +391,8 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
} else if (caught.data.fd == timer_fd) {
|
||||
uint64_t expirations;
|
||||
read(timer_fd, &expirations, sizeof(expirations));
|
||||
ssize_t n = read(timer_fd, &expirations, sizeof(expirations));
|
||||
assert(n >= 0);
|
||||
handle_timer();
|
||||
} else {
|
||||
printf("Unknown source\n");
|
||||
|
Loading…
Reference in New Issue
Block a user