aboutsummaryrefslogtreecommitdiff
path: root/src/protocol/pair/pair_v0.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/protocol/pair/pair_v0.c')
-rw-r--r--src/protocol/pair/pair_v0.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/protocol/pair/pair_v0.c b/src/protocol/pair/pair_v0.c
index acf9ec25..ef420051 100644
--- a/src/protocol/pair/pair_v0.c
+++ b/src/protocol/pair/pair_v0.c
@@ -231,11 +231,9 @@ pair0_sock_setopt(void *arg, int opt, const void *buf, size_t sz)
pair0_sock *s = arg;
int rv;
- switch (opt) {
- case NNG_OPT_RAW:
+ if (opt == nng_optid_raw) {
rv = nni_setopt_int(&s->raw, buf, sz, 0, 1);
- break;
- default:
+ } else {
rv = NNG_ENOTSUP;
}
return (rv);
@@ -247,11 +245,9 @@ pair0_sock_getopt(void *arg, int opt, void *buf, size_t *szp)
pair0_sock *s = arg;
int rv;
- switch (opt) {
- case NNG_OPT_RAW:
+ if (opt == nng_optid_raw) {
rv = nni_getopt_int(&s->raw, buf, szp);
- break;
- default:
+ } else {
rv = NNG_ENOTSUP;
}
return (rv);