From fbcd200fd5d545bc4c4d9220bd88f8cf3c3560e8 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Tue, 14 Nov 2017 12:12:05 +0100 Subject: [PATCH] uev.h: Remind hardcore devs about checking common errors in callback Signed-off-by: Joachim Nilsson --- src/uev.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/uev.h b/src/uev.h index 741416c..3ef7d22 100644 --- a/src/uev.h +++ b/src/uev.h @@ -66,6 +66,11 @@ typedef struct uev { * Generic callback for watchers, @events holds %UEV_READ and/or %UEV_WRITE * with optional %UEV_PRI (priority data available to read) and any of the * %UEV_HUP and/or %UEV_RDHUP, which may be used to signal hang-up events. + * + * Note: UEV_ERROR conditions must be handled by all callbacks! + * I/O watchers may also need to check UEV_HUP. Appropriate action, + * e.g. restart the watcher, is up to the application and is thus + * delegated to the callback. */ typedef void (uev_cb_t)(uev_t *w, void *arg, int events);