From 5b7313273ad99d8da69425beb3b1b3f09025caed Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Tue, 14 Jan 2025 23:22:40 -0800 Subject: pipe: nng_pipe_notify should use nng_err --- include/nng/nng.h | 2 +- src/nng.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/nng/nng.h b/include/nng/nng.h index e2200f17..b3c5ae14 100644 --- a/include/nng/nng.h +++ b/include/nng/nng.h @@ -337,7 +337,7 @@ typedef void (*nng_pipe_cb)(nng_pipe, nng_pipe_ev, void *); // nng_pipe_notify registers a callback to be executed when the // given event is triggered. To watch for different events, register // multiple times. Each event can have at most one callback registered. -NNG_DECL int nng_pipe_notify(nng_socket, nng_pipe_ev, nng_pipe_cb, void *); +NNG_DECL nng_err nng_pipe_notify(nng_socket, nng_pipe_ev, nng_pipe_cb, void *); // nng_listen creates a listening endpoint with no special options, // and starts it listening. It is functionally equivalent to the legacy diff --git a/src/nng.c b/src/nng.c index a98ddda9..68820675 100644 --- a/src/nng.c +++ b/src/nng.c @@ -1174,10 +1174,10 @@ nng_socket_raw(nng_socket id, bool *rawp) return (0); } -int +nng_err nng_pipe_notify(nng_socket s, nng_pipe_ev ev, nng_pipe_cb cb, void *arg) { - int rv; + nng_err rv; nni_sock *sock; if ((rv = nni_sock_find(&sock, s.id)) != 0) { @@ -1186,7 +1186,7 @@ nng_pipe_notify(nng_socket s, nng_pipe_ev ev, nng_pipe_cb cb, void *arg) nni_sock_set_pipe_cb(sock, ev, cb, arg); nni_sock_rele(sock); - return (0); + return (NNG_OK); } void -- cgit v1.2.3-70-g09d2