]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bootctl: use F_TYPE_EQUAL() to compare statfs' .f_type field
authorLennart Poettering <lennart@poettering.net>
Tue, 19 Jul 2016 18:45:10 +0000 (20:45 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 21 Jul 2016 09:37:58 +0000 (11:37 +0200)
After all, the field is kinda borked.

src/boot/bootctl.c

index 5c3e7a04a08fb6fe3bed87149b06718076e3689b..9a24ecd6b29239d5c3a0079b633bdf16fd736e11 100644 (file)
@@ -26,6 +26,7 @@
 #include <ftw.h>
 #include <getopt.h>
 #include <limits.h>
+#include <linux/magic.h>
 #include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -50,6 +51,7 @@
 #include "util.h"
 #include "verbs.h"
 #include "virt.h"
+#include "stat-util.h"
 
 static char *arg_path = NULL;
 static bool arg_touch_variables = true;
@@ -83,7 +85,7 @@ static int verify_esp(
                 return log_error_errno(errno, "Failed to check file system type of \"%s\": %m", p);
         }
 
-        if (sfs.f_type != 0x4d44) {
+        if (!F_TYPE_EQUAL(sfs.f_type, MSDOS_SUPER_MAGIC)) {
 
                 if (searching)
                         return -EADDRNOTAVAIL;