aboutsummaryrefslogtreecommitdiff
path: root/src/nng.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2025-01-14 08:29:37 -0800
committerGarrett D'Amore <garrett@damore.org>2025-01-14 21:11:12 -0800
commit575148ac9a274d61e45220fda7d8de6a420f4fe4 (patch)
tree60e6b255d2aa5fe5a29889c436aba2edb2908bd5 /src/nng.c
parent6dc757342f5f9dedf38de356ae1802546f976bcc (diff)
downloadnng-575148ac9a274d61e45220fda7d8de6a420f4fe4.tar.gz
nng-575148ac9a274d61e45220fda7d8de6a420f4fe4.tar.bz2
nng-575148ac9a274d61e45220fda7d8de6a420f4fe4.zip
api: pipes should use nng_err
Diffstat (limited to 'src/nng.c')
-rw-r--r--src/nng.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/nng.c b/src/nng.c
index d9b111a8..26f45f76 100644
--- a/src/nng.c
+++ b/src/nng.c
@@ -1,5 +1,5 @@
//
-// Copyright 2024 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2025 Staysail Systems, Inc. <info@staysail.tech>
// Copyright 2018 Capitar IT Group BV <info@capitar.com>
//
// This software is supplied under the terms of the MIT License, a
@@ -1301,10 +1301,10 @@ nng_strerror(nng_err num)
return (unknownerrbuf);
}
-static int
+static nng_err
pipe_get(nng_pipe p, const char *name, void *val, size_t *szp, nni_type t)
{
- int rv;
+ nng_err rv;
nni_pipe *pipe;
if ((rv = nni_pipe_find(&pipe, p.id)) != 0) {
@@ -1315,37 +1315,37 @@ pipe_get(nng_pipe p, const char *name, void *val, size_t *szp, nni_type t)
return (rv);
}
-int
+nng_err
nng_pipe_get_int(nng_pipe id, const char *n, int *v)
{
return (pipe_get(id, n, v, NULL, NNI_TYPE_INT32));
}
-int
+nng_err
nng_pipe_get_bool(nng_pipe id, const char *n, bool *v)
{
return (pipe_get(id, n, v, NULL, NNI_TYPE_BOOL));
}
-int
+nng_err
nng_pipe_get_size(nng_pipe id, const char *n, size_t *v)
{
return (pipe_get(id, n, v, NULL, NNI_TYPE_SIZE));
}
-int
+nng_err
nng_pipe_get_string(nng_pipe id, const char *n, char **v)
{
return (pipe_get(id, n, v, NULL, NNI_TYPE_STRING));
}
-int
+nng_err
nng_pipe_get_ms(nng_pipe id, const char *n, nng_duration *v)
{
return (pipe_get(id, n, v, NULL, NNI_TYPE_DURATION));
}
-int
+nng_err
nng_pipe_get_addr(nng_pipe id, const char *n, nng_sockaddr *v)
{
return (pipe_get(id, n, v, NULL, NNI_TYPE_SOCKADDR));
@@ -1388,10 +1388,10 @@ nng_pipe_listener(nng_pipe p)
return (l);
}
-int
+nng_err
nng_pipe_close(nng_pipe p)
{
- int rv;
+ nng_err rv;
nni_pipe *pipe;
if ((rv = nni_pipe_find(&pipe, p.id)) != 0) {
@@ -1399,7 +1399,7 @@ nng_pipe_close(nng_pipe p)
}
nni_pipe_close(pipe);
nni_pipe_rele(pipe);
- return (0);
+ return (NNG_OK);
}
int