Fix error handling in example callbacks

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2021-05-26 23:07:46 +02:00
parent 18000a8ca0
commit 362670e149
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -291,6 +291,7 @@ static void joystick_cb(uev_t *w, void *arg, int events)
/* Possibly joystick was unplugged */
warnx("Spurious problem with the joystick watcher, restarting.");
uev_io_start(w);
return;
}
cnt = read(w->fd, &e, sizeof(e));
+1
View File
@@ -49,6 +49,7 @@ static void cb(uev_t *w, void *arg, int events)
if (UEV_ERROR == events) {
puts("Problem with timer, attempting to restart.");
uev_timer_start(w);
return;
}
puts("Every other second");