]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bootctl: make use of STRV_FOREACH() where we can
authorLennart Poettering <lennart@poettering.net>
Tue, 19 Jul 2016 18:26:24 +0000 (20:26 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 21 Jul 2016 09:37:58 +0000 (11:37 +0200)
src/boot/bootctl.c

index 8b2407f145f7584307422e85982d0a389bf0d482..d9c389739200dcb6c3e6ff8b41736e36e05b7e84 100644 (file)
@@ -628,11 +628,11 @@ static const char *efi_subdirs[] = {
 };
 
 static int create_dirs(const char *esp_path) {
+        const char **i;
         int r;
-        unsigned i;
 
-        for (i = 0; i < ELEMENTSOF(efi_subdirs); i++) {
-                r = mkdir_one(esp_path, efi_subdirs[i]);
+        STRV_FOREACH(i, efi_subdirs) {
+                r = mkdir_one(esp_path, *i);
                 if (r < 0)
                         return r;
         }
@@ -836,7 +836,7 @@ static int install_variables(const char *esp_path,
                                        "Failed to access EFI variables. Is the \"efivarfs\" filesystem mounted?" :
                                        "Failed to determine current boot order: %m");
 
-        if (first || r == false) {
+        if (first || r == 0) {
                 r = efi_add_boot_option(slot, "Linux Boot Manager",
                                         part, pstart, psize,
                                         uuid, path);