summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-06-24 21:03:47 +0200
committerLennart Poettering <lennart@poettering.net>2016-06-24 21:03:47 +0200
commitdbf43a1b3a10b8e50eca3866687989ca5b21dabd (patch)
tree80be39c8e8fd59fd41438e8813ee794020a453b4 /src
parent47be5f0742caf56d38b41ae97dff21303d3ed264 (diff)
systemctl: fix an error condition from "-1" to something meaningful
We really shouldn't make up errors like "-1", but use proper errno definitions.
Diffstat (limited to 'src')
-rw-r--r--src/systemctl/systemctl.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 0a8e60c195..c0b285b58f 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -6175,7 +6175,7 @@ static int unit_file_create_copy(
if (response != 'y') {
log_warning("%s ignored", unit_name);
free(tmp_new_path);
- return -1;
+ return -EKEYREJECTED;
}
}
@@ -6307,10 +6307,8 @@ static int find_paths_to_edit(sd_bus *bus, char **names, char ***paths) {
r = unit_file_create_copy(&lp, *name, path, &new_path, &tmp_path);
else
r = unit_file_create_new(&lp, *name, ".d/override.conf", &new_path, &tmp_path);
- } else {
+ } else
r = unit_file_create_new(&lp, *name, NULL, &new_path, &tmp_path);
- }
-
if (r < 0)
return r;