[systemd-devel] Undocumented return value of `sd_bus_get_timeout`
Marcel Hellwig
mh at cookiesoft.de
Mon May 15 14:17:22 UTC 2023
Dear All,
according to the man page `sd_bus_get_timeout` returns a non-negative value in case of an success, so a typical check should be `r < 0`.
However, in your code there's a distinction between *less than zero*, *zero* and *larger than zero*: https://github.com/systemd/systemd/blob/c06d2e440c07756391c527814611a7f5633a12d9/src/libsystemd/sd-bus/sd-bus.c#L3689-L3692
Is this just internal behaviour or can we rely on that if the value is `0`, the returned timeout is always `UINT64_MAX`?
If so, the documentation should be adjusted, I can make a PR if wanted.
Many thanks,
Marcel
More information about the systemd-devel
mailing list