systemctl: fix an error condition from "-1" to something meaningful

We really shouldn't make up errors like "-1", but use proper errno definitions.
This commit is contained in:
Lennart Poettering 2016-06-24 21:03:47 +02:00
parent 47be5f0742
commit dbf43a1b3a
1 changed files with 2 additions and 4 deletions

View File

@ -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;