src/idmapped-mounts: Fix an error for the loop initialization declaration
[xfstests-dev.git] / src / idmapped-mounts / utils.c
index 6ffd6a2354420640d38c08d1b0e99eef79701d16..c2afa8dc8fa04ac98bdb19ff0f7e7503e329ba12 100644 (file)
@@ -140,11 +140,12 @@ static int map_ids_from_idmap(struct list *idmap, pid_t pid)
        int fill, left;
        char mapbuf[4096] = {};
        bool had_entry = false;
+       idmap_type_t map_type, u_or_g;
 
        if (list_empty(idmap))
                return 0;
 
-       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;