aboutsummaryrefslogtreecommitdiff
path: root/bin/gensquashfs/src/glob.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-09-08 21:24:07 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-09-08 22:24:44 +0200
commitd17046773702aad9cb3269a23ecd35f5a4a552ff (patch)
tree7cb14d8024a869239763590dcc24722c5a9cb72d /bin/gensquashfs/src/glob.c
parentf5e46e0444197deee2eca93d36a8ebeb1ffd7a17 (diff)
genquashfs: detect/filter hardlinks when scanning a directory
The new behavior is enabled by default (except on Windows) and needs to be turned off explicitly. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'bin/gensquashfs/src/glob.c')
-rw-r--r--bin/gensquashfs/src/glob.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/bin/gensquashfs/src/glob.c b/bin/gensquashfs/src/glob.c
index 27b7baa..bc6edee 100644
--- a/bin/gensquashfs/src/glob.c
+++ b/bin/gensquashfs/src/glob.c
@@ -47,6 +47,7 @@ static const struct {
{ "-mount", DIR_SCAN_ONE_FILESYSTEM },
{ "-keeptime", DIR_SCAN_KEEP_TIME },
{ "-nonrecursive", DIR_SCAN_NO_RECURSION },
+ { "-nohardlinks", DIR_SCAN_NO_HARDLINKS },
};
static bool set_scan_flag(const char *arg, dir_tree_cfg_t *cfg)
@@ -176,6 +177,10 @@ int glob_files(fstree_t *fs, const char *filename, size_t line_num,
cfg.prefix = prefix;
cfg.flags = glob_flags;
+#if defined(_WIN32) || defined(__WINDOWS__)
+ cfg.flags |= DIR_SCAN_NO_HARDLINKS;
+#endif
+
while (sep->count != 0) {
if (sep->args[0][0] != '-')
break;