From: Frantisek Sumsal Date: Mon, 25 Dec 2023 18:51:43 +0000 (+0100) Subject: systemctl: use SYNTHETIC_ERRNO() X-Git-Tag: v256-rc1~1384^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F30633%2Fhead;p=thirdparty%2Fsystemd.git systemctl: use SYNTHETIC_ERRNO() --- diff --git a/src/systemctl/systemctl-edit.c b/src/systemctl/systemctl-edit.c index a6bb5e52892..c851c8546ef 100644 --- a/src/systemctl/systemctl-edit.c +++ b/src/systemctl/systemctl-edit.c @@ -247,13 +247,12 @@ static int find_paths_to_edit( return r; /* Already logged by unit_find_paths() */ if (!path) { - if (!arg_force) { - log_info("Run 'systemctl edit%s --force --full %s' to create a new unit.", - arg_runtime_scope == RUNTIME_SCOPE_GLOBAL ? " --global" : - arg_runtime_scope == RUNTIME_SCOPE_USER ? " --user" : "", - *name); - return -ENOENT; - } + if (!arg_force) + return log_info_errno(SYNTHETIC_ERRNO(ENOENT), + "Run 'systemctl edit%s --force --full %s' to create a new unit.", + arg_runtime_scope == RUNTIME_SCOPE_GLOBAL ? " --global" : + arg_runtime_scope == RUNTIME_SCOPE_USER ? " --user" : "", + *name); /* Create a new unit from scratch */ r = unit_file_create_new(