From 02ec0b55cbee5de4d0fd688ce0ebddf08178dc98 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sat, 2 Nov 2024 23:54:27 -0700 Subject: Replace `NNG_OPT_RAW` with `nng_socket_raw`. Similar to the other identities, this simplifies code a bit. --- src/core/device.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'src/core/device.c') 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. +// Copyright 2024 Staysail Systems, Inc. // Copyright 2018 Capitar IT Group BV // // 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); } -- cgit v1.2.3-70-g09d2