]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
systemctl: fix an error condition from "-1" to something meaningful
authorLennart Poettering <lennart@poettering.net>
Fri, 24 Jun 2016 19:03:47 +0000 (21:03 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 24 Jun 2016 19:03:47 +0000 (21:03 +0200)
We really shouldn't make up errors like "-1", but use proper errno definitions.

src/systemctl/systemctl.c

index 0a8e60c1957dacda3a1bf9719703ec111ca940c9..c0b285b58ff5fa06793bc7a43910b24122f5db3d 100644 (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;