On Linux, poll accepts any negative value as infinity.
On at least FreeBSD and NetBSD, only -1 is acceptable.
[adjusted whitespace for correct coding style -smcv]
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=78480
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
_DBUS_STRUCT_OFFSET (DBusPollFD, revents) ==
_DBUS_STRUCT_OFFSET (struct pollfd, revents))
{
+ if (timeout_milliseconds < -1)
+ {
+ timeout_milliseconds = -1;
+ }
+
return poll ((struct pollfd*) fds,
n_fds,
timeout_milliseconds);