mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-08 18:28:03 +02:00
Don't call poll(2) with timeout < -1
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>
This commit is contained in:
parent
980ef1d534
commit
be241064f8
1 changed files with 5 additions and 0 deletions
|
|
@ -2573,6 +2573,11 @@ _dbus_poll (DBusPollFD *fds,
|
|||
_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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue