sd-daemon: make sd_booted() return negative errno on unexpected error
This commit is contained in:
committed by
Lennart Poettering
parent
e327272d79
commit
21042737f0
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user