summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2021-01-14 15:02:27 +0100
committerLennart Poettering <lennart@poettering.net>2021-01-14 15:02:27 +0100
commit1842c1b2abbe46ab4b874e9eb7fa041f4ce8def6 (patch)
treeb456c2be39a9d0e6873b58a340598fabe79fe593
parentd5427dd29796a1ea464ed95e5ed3f0a0941ce01a (diff)
downloadsystemd-1842c1b2abbe46ab4b874e9eb7fa041f4ce8def6.tar.gz
systemctl: explicitly comment two cases where we don't log on error cases, on purpose
-rw-r--r--src/systemctl/systemctl-util.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/systemctl/systemctl-util.c b/src/systemctl/systemctl-util.c
index aff247a881..262854537d 100644
--- a/src/systemctl/systemctl-util.c
+++ b/src/systemctl/systemctl-util.c
@@ -439,12 +439,15 @@ int unit_find_paths(
/**
* Finds where the unit is defined on disk. Returns 0 if the unit is not found. Returns 1 if it is
* found, and sets:
+ *
* - the path to the unit in *ret_frament_path, if it exists on disk,
+ *
* - and a strv of existing drop-ins in *ret_dropin_paths, if the arg is not NULL and any dropins
* were found.
*
* Returns -ERFKILL if the unit is masked, and -EKEYREJECTED if the unit file could not be loaded for
- * some reason (the latter only applies if we are going through the service manager).
+ * some reason (the latter only applies if we are going through the service manager). As special
+ * exception it won't log for these two error cases.
*/
assert(unit_name);
@@ -474,13 +477,13 @@ int unit_find_paths(
return log_error_errno(r, "Failed to get LoadState: %s", bus_error_message(&error, r));
if (streq(load_state, "masked"))
- return -ERFKILL;
+ return -ERFKILL; /* special case: no logging */
if (streq(load_state, "not-found")) {
r = 0;
goto finish;
}
if (!STR_IN_SET(load_state, "loaded", "bad-setting"))
- return -EKEYREJECTED;
+ return -EKEYREJECTED; /* special case: no logging */
r = sd_bus_get_property_string(
bus,