diff --git a/src/libsystemd/sd-daemon/sd-daemon.c b/src/libsystemd/sd-daemon/sd-daemon.c index 218210f234..9e8f0a73f5 100644 --- a/src/libsystemd/sd-daemon/sd-daemon.c +++ b/src/libsystemd/sd-daemon/sd-daemon.c @@ -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) {