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:
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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user