]> git.ipfire.org Git - thirdparty/systemd.git/commit
sd-bus: fix use of ERRNO_IS_DISCONNECT()
authorDmitry V. Levin <ldv@strace.io>
Fri, 7 Jul 2023 08:00:00 +0000 (08:00 +0000)
committerDmitry V. Levin <ldv@strace.io>
Sun, 16 Jul 2023 10:53:30 +0000 (10:53 +0000)
commitbb228f0ebc9b691ee2a871bffbf949936568f3ea
tree32b3a7774fb66aca87c9bf6821ccd713e1508504
parentd5f8890bbf375075c7042b31ff6e79ad491df04c
sd-bus: fix use of ERRNO_IS_DISCONNECT()

Given that ERRNO_IS_DISCONNECT() also matches positive values,
make sure this macro is not called with arguments that do not have
errno semantics.

In this case the argument passed to ERRNO_IS_DISCONNECT() is the value
returned by bus_socket_process_watch_bind(), bus_socket_process_opening(),
and bus_socket_process_authenticating() which can legitimately return
positive values without errno semantics, so fix this by moving the
ERRNO_IS_DISCONNECT() invocation to the branch where the return value
is known to be negative.
src/libsystemd/sd-bus/sd-bus.c