pid1: unify implemenation of /run/ disk space safety check a bit
authorLennart Poettering <lennart@poettering.net>
Fri, 28 Apr 2023 14:14:32 +0000 (16:14 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 28 Apr 2023 22:27:20 +0000 (23:27 +0100)
commitc23e9b6a64b3bdf44127a69d5eeaa2c116b40aba
treed15ab65e614af96cdcc08ee4f6191c30656091fe
parent5ae89ef34774a777c5af7af48b1ad431d10a425e
pid1: unify implemenation of /run/ disk space safety check a bit

reload/reexec currently used a separate implementation of the /run/ disk
space check, different from the one used for switch-root, even though
the code is mostly the same. The one difference is that the former
checks are authoritative, the latter are just informational (that's
because refusing a reload/reexec is relatively benign, but refusing a
switch-root quite troublesome, since this code is entered when it's
already "too late" to turn turn back, i.e. when the preparatory
transaction to initiate the switch root are already fully executed.

Let's share some code, and unify codepaths.

(This is preparation for later addition of a "userspace reboot" concept)

No change in behaviour, just refactoring.
src/core/dbus-manager.c