aboutsummaryrefslogtreecommitdiff
path: root/bin/gensquashfs
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-04-19 09:44:35 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-04-19 11:17:54 +0200
commit982db0d8d6fdc32d605f716bd891b5bbc4838608 (patch)
tree75951fd94cad1f7f94e7bd86a7fdbbe4045726e7 /bin/gensquashfs
parent75fb524b5702bca4f8467309f7d95f9937ec6683 (diff)
libfstree: Change file_info_t already_matched into flag
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'bin/gensquashfs')
-rw-r--r--bin/gensquashfs/src/sort_by_file.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/bin/gensquashfs/src/sort_by_file.c b/bin/gensquashfs/src/sort_by_file.c
index bc89c39..6a428ab 100644
--- a/bin/gensquashfs/src/sort_by_file.c
+++ b/bin/gensquashfs/src/sort_by_file.c
@@ -257,9 +257,11 @@ int fstree_sort_files(fstree_t *fs, istream_t *sortfile)
file_info_t *it;
for (it = fs->files; it != NULL; it = it->next) {
+ tree_node_t *node = container_of(it, tree_node_t, data.file);
+
it->priority = 0;
it->flags = 0;
- it->already_matched = false;
+ node->flags &= ~FLAG_FILE_ALREADY_MATCHED;
}
filename = istream_get_filename(sortfile);
@@ -308,10 +310,10 @@ int fstree_sort_files(fstree_t *fs, istream_t *sortfile)
tree_node_t *node;
char *path;
- if (it->already_matched)
+ node = container_of(it, tree_node_t, data.file);
+ if (node->flags & FLAG_FILE_ALREADY_MATCHED)
continue;
- node = container_of(it, tree_node_t, data.file);
path = fstree_get_path(node);
if (path == NULL) {
fprintf(stderr, "%s: " PRI_SZ ": out-of-memory\n",
@@ -344,7 +346,7 @@ int fstree_sort_files(fstree_t *fs, istream_t *sortfile)
have_match = true;
it->flags = flags;
it->priority = priority;
- it->already_matched = true;
+ node->flags |= FLAG_FILE_ALREADY_MATCHED;
if (!do_glob)
break;