mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2025-12-20 04:30:10 +01:00
connection: Never call _dbus_condvar_wait_timeout() with negative timeout
Previously we were checking for -1 as the special-cased "block forever" value, but as noted on dbus!524 it is a programming error to call _dbus_condvar_wait_timeout() with any negative timeout. Throughout DBusConnection the timeout is in fact constrained to be >= -1 (non-negative to have a timeout, or exactly -1 to block forever) but checking for non-negative is presumably no more expensive than checking for exactly -1, so let's be a little more defensive here, to make it more obvious that we're doing this correctly. This is the only caller of _dbus_condvar_wait_timeout() in our codebase. Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
parent
cee059de0c
commit
e3dcdc6227
1 changed files with 1 additions and 1 deletions
|
|
@ -1085,7 +1085,7 @@ _dbus_connection_acquire_io_path (DBusConnection *connection,
|
|||
|
||||
if (connection->io_path_acquired)
|
||||
{
|
||||
if (timeout_milliseconds != -1)
|
||||
if (timeout_milliseconds >= 0)
|
||||
{
|
||||
_dbus_verbose ("waiting %d for IO path to be acquirable\n",
|
||||
timeout_milliseconds);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue