aboutsummaryrefslogtreecommitdiff
path: root/src/core/device.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-11-02 23:54:27 -0700
committerGarrett D'Amore <garrett@damore.org>2024-11-02 23:54:27 -0700
commit02ec0b55cbee5de4d0fd688ce0ebddf08178dc98 (patch)
tree6cb65f860f8f9992b14139f52bf065c48f7b5a58 /src/core/device.c
parent8bac5ccdf1de7334311459b9e2666e74a2c16c15 (diff)
downloadnng-02ec0b55cbee5de4d0fd688ce0ebddf08178dc98.tar.gz
nng-02ec0b55cbee5de4d0fd688ce0ebddf08178dc98.tar.bz2
nng-02ec0b55cbee5de4d0fd688ce0ebddf08178dc98.zip
Replace `NNG_OPT_RAW` with `nng_socket_raw`.
Similar to the other identities, this simplifies code a bit.
Diffstat (limited to 'src/core/device.c')
-rw-r--r--src/core/device.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/core/device.c b/src/core/device.c
index 08c7bab5..7a6fb479 100644
--- a/src/core/device.c
+++ b/src/core/device.c
@@ -1,5 +1,5 @@
//
-// Copyright 2021 Staysail Systems, Inc. <info@staysail.com>
+// Copyright 2024 Staysail Systems, Inc. <info@staysail.com>
// Copyright 2018 Capitar IT Group BV <info@capitar.com>
//
// This software is supplied under the terms of the MIT License, a
@@ -128,8 +128,6 @@ device_init(device_data **dp, nni_sock *s1, nni_sock *s2)
{
int num_paths = 2;
int i;
- bool raw;
- size_t rsz;
device_data *d;
// Specifying either of these as null turns the device into
@@ -149,18 +147,11 @@ device_init(device_data **dp, nni_sock *s1, nni_sock *s2)
return (NNG_EINVAL);
}
- raw = false;
- rsz = sizeof(raw);
- if (((nni_sock_getopt(s1, NNG_OPT_RAW, &raw, &rsz, NNI_TYPE_BOOL) !=
- 0)) ||
- (!raw)) {
+ if (!nni_sock_raw(s1)) {
return (NNG_EINVAL);
}
- rsz = sizeof(raw);
- if (((nni_sock_getopt(s2, NNG_OPT_RAW, &raw, &rsz, NNI_TYPE_BOOL) !=
- 0)) ||
- (!raw)) {
+ if (!nni_sock_raw(s2)) {
return (NNG_EINVAL);
}