diff options
| author | Garrett D'Amore <garrett@damore.org> | 2016-12-25 09:31:42 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2016-12-25 09:31:42 -0800 |
| commit | 37a89f82a444acd2004041c758125474fe0dd08b (patch) | |
| tree | ecbcabaae8985e801d069fbae34507ed8780b640 /src/nng.c | |
| parent | 7acc29013636d2ddc004acebe02d88722fe0c8db (diff) | |
| download | nng-37a89f82a444acd2004041c758125474fe0dd08b.tar.gz nng-37a89f82a444acd2004041c758125474fe0dd08b.tar.bz2 nng-37a89f82a444acd2004041c758125474fe0dd08b.zip | |
Fallback to socket options if pipe doesn't have a specific value.
Diffstat (limited to 'src/nng.c')
| -rw-r--r-- | src/nng.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -158,8 +158,14 @@ nng_strerror(int num) int nng_pipe_getopt(nng_pipe *pipe, int opt, void *val, size_t *sizep) { + int rv; NNI_INIT_INT(); - return (nni_pipe_getopt(pipe, opt, val, sizep)); + rv = nni_pipe_getopt(pipe, opt, val, sizep); + if (rv == ENOTSUP) { + // Maybe its a generic socket option. + rv = nni_socket_getopt(pipe->p_sock, opt, val, sizep); + } + return (rv); } |
