diff options
author | Martin Sustrik <sustrik@250bpm.com> | 2012-03-13 15:27:02 +0100 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2012-03-13 15:27:02 +0100 |
commit | b871611cc36eaaf740a5c8f476cf53fe40299eb3 (patch) | |
tree | e4d8426a2e9d4bdef2ace26f7a5bf097037d810d | |
parent | 28a707371ff9414a1394c52de182ac295eaa00d7 (diff) |
'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 <sustrik@250bpm.com>
-rw-r--r-- | include/xs.h | 2 | ||||
-rw-r--r-- | src/upoll.cpp | 6 | ||||
-rw-r--r-- | src/upoll.hpp | 2 | ||||
-rw-r--r-- | src/xs.cpp | 2 |
4 files changed, 5 insertions, 7 deletions
diff --git a/include/xs.h b/include/xs.h index f61a41a..5c781ea 100644 --- a/include/xs.h +++ b/include/xs.h @@ -239,7 +239,7 @@ typedef struct short revents; } xs_pollitem_t; -XS_EXPORT int xs_poll (xs_pollitem_t *items, int nitems, long timeout); +XS_EXPORT int xs_poll (xs_pollitem_t *items, int nitems, int timeout); /******************************************************************************/ /* The following utility functions are exported for use from language */ 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 <unistd.h> #endif -#include <limits.h> - -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 @@ -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_); } |