src/idmapped-mounts: Remove useless header file
[xfstests-dev.git] / src / idmapped-mounts / mount-idmapped.c
index 5f5ba5d21658939bdb219db9c6ac98f6850e047b..219104e763690aada2c55b62d8d4e95c67f801de 100644 (file)
@@ -9,11 +9,8 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <getopt.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <getopt.h>
-#include <libgen.h>
 #include <limits.h>
 #include <limits.h>
-#include <linux/bpf.h>
 #include <linux/sched.h>
 #include <linux/sched.h>
-#include <linux/seccomp.h>
 #include <sched.h>
 #include <signal.h>
 #include <stdbool.h>
 #include <sched.h>
 #include <signal.h>
 #include <stdbool.h>
@@ -21,7 +18,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <sys/mman.h>
 #include <sys/stat.h>
 #include <sys/syscall.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/syscall.h>
 #include <sys/types.h>
@@ -137,7 +133,7 @@ static int add_map_entry(__u32 id_host,
 static int parse_map(char *map)
 {
        char types[2] = {'u', 'g'};
 static int parse_map(char *map)
 {
        char types[2] = {'u', 'g'};
-       int ret;
+       int ret, i;
        __u32 id_host, id_ns, range;
        char which;
 
        __u32 id_host, id_ns, range;
        char which;
 
@@ -151,7 +147,7 @@ static int parse_map(char *map)
        if (which != 'b' && which != 'u' && which != 'g')
                return -1;
 
        if (which != 'b' && which != 'u' && which != 'g')
                return -1;
 
-       for (int i = 0; i < 2; i++) {
+       for (i = 0; i < 2; i++) {
                idmap_type_t map_type;
 
                if (which != types[i] && which != 'b')
                idmap_type_t map_type;
 
                if (which != types[i] && which != 'b')
@@ -230,8 +226,9 @@ static int map_ids_from_idmap(struct list *idmap, pid_t pid)
        int fill, left;
        char mapbuf[4096] = {};
        bool had_entry = false;
        int fill, left;
        char mapbuf[4096] = {};
        bool had_entry = false;
+       idmap_type_t map_type, u_or_g;
 
 
-       for (idmap_type_t map_type = ID_TYPE_UID, u_or_g = 'u';
+       for (map_type = ID_TYPE_UID, u_or_g = 'u';
             map_type <= ID_TYPE_GID; map_type++, u_or_g = 'g') {
                char *pos = mapbuf;
                int ret;
             map_type <= ID_TYPE_GID; map_type++, u_or_g = 'g') {
                char *pos = mapbuf;
                int ret;