summaryrefslogtreecommitdiff
path: root/src/options.cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2011-03-24 15:43:03 +0100
committerMartin Sustrik <sustrik@250bpm.com>2011-03-24 15:43:03 +0100
commit507718ee1a56e376c06389c513de3868297fec35 (patch)
tree1b007ee25899ed3c6971ae2001bb252f128b2d55 /src/options.cpp
parentbd9d7715ebe864d1aa85700d1b55b4f37568a1a4 (diff)
ZMQ_HWM type changed to int
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/options.cpp')
-rw-r--r--src/options.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/options.cpp b/src/options.cpp
index 13332da..39f8984 100644
--- a/src/options.cpp
+++ b/src/options.cpp
@@ -50,11 +50,11 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
switch (option_) {
case ZMQ_HWM:
- if (optvallen_ != sizeof (uint64_t)) {
+ if (optvallen_ != sizeof (int) || *((int*) optval_) < 0) {
errno = EINVAL;
return -1;
}
- hwm = *((uint64_t*) optval_);
+ hwm = *((int*) optval_);
return 0;
case ZMQ_AFFINITY:
@@ -169,11 +169,11 @@ int zmq::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_)
switch (option_) {
case ZMQ_HWM:
- if (*optvallen_ < sizeof (uint64_t)) {
+ if (*optvallen_ < sizeof (int)) {
errno = EINVAL;
return -1;
}
- *((uint64_t*) optval_) = hwm;
+ *((int*) optval_) = hwm;
*optvallen_ = sizeof (uint64_t);
return 0;