mirror of
https://github.com/morgan9e/systemd
synced 2026-04-15 00:47:10 +09:00
systemctl: use SYNTHETIC_ERRNO()
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user