From: Lennart Poettering Date: Thu, 14 Jan 2021 14:02:27 +0000 (+0100) Subject: systemctl: explicitly comment two cases where we don't log on error cases, on purpose X-Git-Tag: v248-rc1~346^2~1 X-Git-Url: http://git-history.diyao.me/?a=commitdiff_plain;h=1842c1b2abbe46ab4b874e9eb7fa041f4ce8def6;p=systemd%2F.git systemctl: explicitly comment two cases where we don't log on error cases, on purpose --- 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,