summaryrefslogtreecommitdiffstats
path: root/src/shared
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2020-05-14 10:07:34 +0200
committerLennart Poettering <lennart@poettering.net>2020-05-18 20:20:50 +0200
commit5439d8212c97d7dd8af48f9b52146710ecda4767 (patch)
treeea352c1502c454ab6bae184b0e047ac834ba2166 /src/shared
parentcondition: reverse if check to lower indentation level (diff)
downloadsystemd-5439d8212c97d7dd8af48f9b52146710ecda4767.tar.xz
systemd-5439d8212c97d7dd8af48f9b52146710ecda4767.zip
condition: debug log if F_OK check on /run/systemd/first-boot fails unexpectedly
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/condition.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/shared/condition.c b/src/shared/condition.c
index b25e4f12b1..b17403855a 100644
--- a/src/shared/condition.c
+++ b/src/shared/condition.c
@@ -626,7 +626,7 @@ static int condition_test_needs_update(Condition *c, char **env) {
}
static int condition_test_first_boot(Condition *c, char **env) {
- int r;
+ int r, q;
assert(c);
assert(c->parameter);
@@ -636,7 +636,11 @@ static int condition_test_first_boot(Condition *c, char **env) {
if (r < 0)
return r;
- return (access("/run/systemd/first-boot", F_OK) >= 0) == !!r;
+ q = access("/run/systemd/first-boot", F_OK);
+ if (q < 0 && errno != ENOENT)
+ log_debug_errno(errno, "Failed to check if /run/systemd/first-boot exists, ignoring: %m");
+
+ return (q >= 0) == !!r;
}
static int condition_test_environment(Condition *c, char **env) {