summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2008-03-07 14:17:56 +0000
committerMarcel Holtmann <marcel@holtmann.org>2008-03-07 14:17:56 +0000
commitb866782105bd76c0f7f2c2bc9e2f4a25d3b0d0fe (patch)
tree9a8852026d359d7d43ef31d56fb7ba467a16a7a3 /common
parent5a14261153a166511b651572ca76708ad3d8ea52 (diff)
Fix handling of compat_ppoll when no timeout is specified
Diffstat (limited to 'common')
-rw-r--r--common/ppoll.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/common/ppoll.h b/common/ppoll.h
index d9096901..7d09d44d 100644
--- a/common/ppoll.h
+++ b/common/ppoll.h
@@ -7,5 +7,10 @@
static inline int compat_ppoll(struct pollfd *fds, nfds_t nfds,
const struct timespec *timeout, const sigset_t *sigmask)
{
- return poll(fds, nfds, timeout ? timeout->tv_sec * 1000 : 500);
+ if (timeout == NULL)
+ return poll(fds, nfds, -1);
+ else if (timeout->tv_sec == 0)
+ return poll(fds, nfds, 500);
+ else
+ return poll(fds, nfds, timeout->tv_sec * 1000);
}