summaryrefslogtreecommitdiff
path: root/src/systemctl
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2023-03-11 17:18:29 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2023-03-11 22:19:22 +0900
commit7a2a7f2c00b1cbba2687bea359152a94565aad59 (patch)
tree717f919deef779e67e177d4100ff846563302342 /src/systemctl
parent9c344052418f8768a60f12fecbd1e242f5f142e9 (diff)
downloadsystemd-7a2a7f2c00b1cbba2687bea359152a94565aad59.tar.gz
systemctl-edit: shorten code a bit
Diffstat (limited to 'src/systemctl')
-rw-r--r--src/systemctl/systemctl-edit.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/systemctl/systemctl-edit.c b/src/systemctl/systemctl-edit.c
index d85abbd165..ad8c96bd3a 100644
--- a/src/systemctl/systemctl-edit.c
+++ b/src/systemctl/systemctl-edit.c
@@ -160,11 +160,7 @@ static int unit_file_create_new(
if (r < 0)
return r;
- r = edit_files_add(context, new_path, NULL, original_unit_paths);
- if (r < 0)
- return r;
-
- return 0;
+ return edit_files_add(context, new_path, NULL, original_unit_paths);
}
static int unit_file_create_copy(
@@ -196,11 +192,7 @@ static int unit_file_create_copy(
return log_warning_errno(SYNTHETIC_ERRNO(EKEYREJECTED), "%s skipped.", unit_name);
}
- r = edit_files_add(context, new_path, fragment_path, NULL);
- if (r < 0)
- return r;
-
- return 0;
+ return edit_files_add(context, new_path, fragment_path, NULL);
}
static int find_paths_to_edit(