Commit c6c6b423 authored by David King's avatar David King Committed by Simon McVittie

_dbus_get_is_errno_eagain_or_ewouldblock: Avoid warning

EAGAIN and EWOULDBLOCK are documented to possibly be numerically equal,
for instance in errno(3), and a simple logical OR check will trigger the
-Wlogical-op warning of GCC. The GCC developers consider the warning to
work as-designed in this case:

Avoid such a warning by explicitly checking if the values are identical.

Fixes: #225Signed-off-by: 's avatarDavid King <>
Reviewed-by: Simon McVittie's avatarSimon McVittie <>
(cherry picked from commit a6531913)
parent 2fb62561
......@@ -4364,7 +4364,15 @@ _dbus_daemon_unpublish_session_bus_address (void)
_dbus_get_is_errno_eagain_or_ewouldblock (int e)
/* Avoid the -Wlogical-op GCC warning, which can be triggered when EAGAIN and
* EWOULDBLOCK are numerically equal, which is permitted as described by
* errno(3).
return e == EAGAIN;
return e == EAGAIN || e == EWOULDBLOCK;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment