From f212479e9ab13c79a9277dfef4924d8f9ce442eb Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Sat, 3 Jan 2015 14:39:15 +0000 Subject: Easier error reporting in unixmessage_handle --- src/libunixonacid/unixmessage_handle.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libunixonacid/unixmessage_handle.c b/src/libunixonacid/unixmessage_handle.c index ad5789c..db92b6c 100644 --- a/src/libunixonacid/unixmessage_handle.c +++ b/src/libunixonacid/unixmessage_handle.c @@ -12,7 +12,8 @@ int unixmessage_handle (unixmessage_receiver_t *b, unixmessage_handler_func_t *f register int r = unixmessage_receive(b, &m) ; if (r < 0) return -1 ; if (!r) break ; - if (!(*f)(&m, p)) return -2 ; + r = (*f)(&m, p) ; + if (r <= 0) return r ; count++ ; } return count ; -- cgit v1.2.3