Skip to content

Commit dbf43a1

Browse files
committed
systemctl: fix an error condition from "-1" to something meaningful
We really shouldn't make up errors like "-1", but use proper errno definitions.
1 parent 47be5f0 commit dbf43a1

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/systemctl/systemctl.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6175,7 +6175,7 @@ static int unit_file_create_copy(
61756175
if (response != 'y') {
61766176
log_warning("%s ignored", unit_name);
61776177
free(tmp_new_path);
6178-
return -1;
6178+
return -EKEYREJECTED;
61796179
}
61806180
}
61816181

@@ -6307,10 +6307,8 @@ static int find_paths_to_edit(sd_bus *bus, char **names, char ***paths) {
63076307
r = unit_file_create_copy(&lp, *name, path, &new_path, &tmp_path);
63086308
else
63096309
r = unit_file_create_new(&lp, *name, ".d/override.conf", &new_path, &tmp_path);
6310-
} else {
6310+
} else
63116311
r = unit_file_create_new(&lp, *name, NULL, &new_path, &tmp_path);
6312-
}
6313-
63146312
if (r < 0)
63156313
return r;
63166314

0 commit comments

Comments
 (0)