From eb01ccca21a9a2e1693b28871f65934e8931e3bf Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Sun, 11 Aug 2019 00:31:17 +0200 Subject: Replace fstree_from_dir boolean with flag field Signed-off-by: David Oberhollenzer --- lib/fstree/fstree_from_dir.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/fstree') diff --git a/lib/fstree/fstree_from_dir.c b/lib/fstree/fstree_from_dir.c index a216226..0c56148 100644 --- a/lib/fstree/fstree_from_dir.c +++ b/lib/fstree/fstree_from_dir.c @@ -52,7 +52,7 @@ fail: return NULL; } -static int populate_dir(fstree_t *fs, tree_node_t *root, bool keep_time_stamps) +static int populate_dir(fstree_t *fs, tree_node_t *root, unsigned int flags) { char *extra = NULL; struct dirent *ent; @@ -101,7 +101,7 @@ static int populate_dir(fstree_t *fs, tree_node_t *root, bool keep_time_stamps) goto fail; } - if (!keep_time_stamps) + if (!(flags & DIR_SCAN_KEEP_TIME)) sb.st_mtim = fs->defaults.st_mtim; n = fstree_mknode(fs, root, ent->d_name, strlen(ent->d_name), @@ -122,7 +122,7 @@ static int populate_dir(fstree_t *fs, tree_node_t *root, bool keep_time_stamps) if (pushd(n->name)) return -1; - if (populate_dir(fs, n, keep_time_stamps)) + if (populate_dir(fs, n, flags)) return -1; if (popd()) @@ -139,14 +139,14 @@ fail: return -1; } -int fstree_from_dir(fstree_t *fs, const char *path, bool keep_time_stamps) +int fstree_from_dir(fstree_t *fs, const char *path, unsigned int flags) { int ret; if (pushd(path)) return -1; - ret = populate_dir(fs, fs->root, keep_time_stamps); + ret = populate_dir(fs, fs->root, flags); if (popd()) ret = -1; -- cgit v1.2.3