mirror of
https://github.com/systemd/systemd
synced 2024-10-02 22:37:25 +00:00
systemctl: use SYNTHETIC_ERRNO()
This commit is contained in:
parent
0b3c270896
commit
8451e720d8
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue