From 507718ee1a56e376c06389c513de3868297fec35 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Thu, 24 Mar 2011 15:43:03 +0100 Subject: ZMQ_HWM type changed to int Signed-off-by: Martin Sustrik --- src/options.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/options.cpp') 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; -- cgit v1.2.3