summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/zmq_getsockopt.txt2
-rw-r--r--src/socket_base.cpp10
2 files changed, 6 insertions, 6 deletions
diff --git a/doc/zmq_getsockopt.txt b/doc/zmq_getsockopt.txt
index be3c17f..8189cf3 100644
--- a/doc/zmq_getsockopt.txt
+++ b/doc/zmq_getsockopt.txt
@@ -316,7 +316,7 @@ the 'ZMQ_EVENTS' option is valid; applications should simply ignore this case
and restart their polling operation/event loop.
[horizontal]
-Option value type:: uint32_t
+Option value type:: int
Option value unit:: N/A (flags)
Default value:: N/A
Applicable socket types:: all
diff --git a/src/socket_base.cpp b/src/socket_base.cpp
index a41622e..351e3c5 100644
--- a/src/socket_base.cpp
+++ b/src/socket_base.cpp
@@ -264,7 +264,7 @@ int zmq::socket_base_t::getsockopt (int option_, void *optval_,
}
if (option_ == ZMQ_EVENTS) {
- if (*optvallen_ < sizeof (uint32_t)) {
+ if (*optvallen_ < sizeof (int)) {
errno = EINVAL;
return -1;
}
@@ -272,12 +272,12 @@ int zmq::socket_base_t::getsockopt (int option_, void *optval_,
if (rc != 0 && (errno == EINTR || errno == ETERM))
return -1;
errno_assert (rc == 0);
- *((uint32_t*) optval_) = 0;
+ *((int*) optval_) = 0;
if (has_out ())
- *((uint32_t*) optval_) |= ZMQ_POLLOUT;
+ *((int*) optval_) |= ZMQ_POLLOUT;
if (has_in ())
- *((uint32_t*) optval_) |= ZMQ_POLLIN;
- *optvallen_ = sizeof (uint32_t);
+ *((int*) optval_) |= ZMQ_POLLIN;
+ *optvallen_ = sizeof (int);
return 0;
}