summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-08-11 00:31:17 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-08-11 00:31:17 +0200
commiteb01ccca21a9a2e1693b28871f65934e8931e3bf (patch)
tree2a2c76e4bbb3668fdf4e0aa667c80519c76b01f4 /lib
parentb3c3401aee91bc2ff46ba0eab0ceb88c78cb5bbb (diff)
Replace fstree_from_dir boolean with flag field
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib')
-rw-r--r--lib/fstree/fstree_from_dir.c10
1 files changed, 5 insertions, 5 deletions
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;