1
0
mirror of https://github.com/systemd/systemd.git synced 2025-02-13 01:57:42 +03:00

sd-daemon: make sd_booted() return negative errno on unexpected error

This commit is contained in:
Yu Watanabe 2019-02-06 19:07:34 +01:00 committed by Lennart Poettering
parent e327272d79
commit 21042737f0

View File

@ -604,7 +604,13 @@ _public_ int sd_booted(void) {
* created. This takes place in mount-setup.c, so is
* guaranteed to happen very early during boot. */
return laccess("/run/systemd/system/", F_OK) >= 0;
if (laccess("/run/systemd/system/", F_OK) >= 0)
return true;
if (errno == ENOENT)
return false;
return -errno;
}
_public_ int sd_watchdog_enabled(int unset_environment, uint64_t *usec) {