Commit a6531913 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: dbus/dbus#225Signed-off-by: 's avatarDavid King <>
Reviewed-by: Simon McVittie's avatarSimon McVittie <>
parent 70bfb94b
Pipeline #5953 passed with stage
in 20 minutes and 31 seconds
......@@ -4604,7 +4604,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