mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 08:25:20 +09:00
Previously, when compiled in developer mode, a call into libsystemd with invalid parameters would result in an abort. This means that it's effectively impossible to install such libsystemd in a normal system, since various third-party programs may now abort. A shared library should generally never abort or exit the calling program. In python-systemd, the test suite calls into libsystemd, to check if the proper return values are received and propagated through the Python wrappers. Obviously with libsystemd compiled from git, the test suite now fails in a nasty way. So rework the code to set assert_return_is_critical similarly to how we handle mempool enablement: the function that returns true is declared as a week symbol, and we "opt in" by linking a file that provides the function in libsystemd-shared. Effectively, libsystemd and libudev always have assert_return_is_critical==false, and our binaries and modules enable it conditionally.