From b871611cc36eaaf740a5c8f476cf53fe40299eb3 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Tue, 13 Mar 2012 15:27:02 +0100 Subject: 'timeout' parameter in xs_poll changed to int Originally, the parameter was of type long which is incompatible with POSIX poll() function. Signed-off-by: Martin Sustrik --- src/upoll.cpp | 6 ++---- src/upoll.hpp | 2 +- src/xs.cpp | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/upoll.cpp b/src/upoll.cpp index 9e66279..3295bba 100644 --- a/src/upoll.cpp +++ b/src/upoll.cpp @@ -56,12 +56,10 @@ #include #endif -#include - -int xs::upoll (xs_pollitem_t *items_, int nitems_, long timeout_) +int xs::upoll (xs_pollitem_t *items_, int nitems_, int timeout_) { #if defined XS_POLL_BASED_ON_POLL - if (unlikely (nitems_ < 0 || timeout_ > INT_MAX)) { + if (unlikely (nitems_ < 0)) { errno = EINVAL; return -1; } diff --git a/src/upoll.hpp b/src/upoll.hpp index 9e6b5be..d63df5e 100644 --- a/src/upoll.hpp +++ b/src/upoll.hpp @@ -26,7 +26,7 @@ namespace xs { // Underlying function for xs_poll. - int upoll (xs_pollitem_t *items_, int nitems_, long timeout_); + int upoll (xs_pollitem_t *items_, int nitems_, int timeout_); } #endif diff --git a/src/xs.cpp b/src/xs.cpp index 36d40da..7f4cdd2 100644 --- a/src/xs.cpp +++ b/src/xs.cpp @@ -347,7 +347,7 @@ int xs_getmsgopt (xs_msg_t *msg_, int option_, void *optval_, } } -int xs_poll (xs_pollitem_t *items_, int nitems_, long timeout_) +int xs_poll (xs_pollitem_t *items_, int nitems_, int timeout_) { return xs::upoll (items_, nitems_, timeout_); } -- cgit v1.2.3