From 362670e1494068307dd00ef2051e75a767731691 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sun, 23 May 2021 19:48:01 +0200 Subject: [PATCH] Fix error handling in example callbacks Signed-off-by: Joachim Wiberg --- API.md | 1 + README.md | 1 + 2 files changed, 2 insertions(+) diff --git a/API.md b/API.md index 5f0bba1..61f8c75 100644 --- a/API.md +++ b/API.md @@ -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)); diff --git a/README.md b/README.md index 73d099c..774c5b1 100644 --- a/README.md +++ b/README.md @@ -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");