diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-08-21 15:49:38 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-08-21 15:49:38 +0200 |
commit | 41bf6b0aa2594b8cd5732ca51982f5f95fe63724 (patch) | |
tree | a1ae73219374027023d920dbf113acfb760d6cfe | |
parent | b5d6fe8f20aed1304bb7531d35c6866563de078f (diff) |
Fix timestamp comparison for directory source
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
-rw-r--r-- | difftool/sqfsdiff.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/difftool/sqfsdiff.c b/difftool/sqfsdiff.c index 28f86bd..05a7bfe 100644 --- a/difftool/sqfsdiff.c +++ b/difftool/sqfsdiff.c @@ -8,7 +8,7 @@ int main(int argc, char **argv) { - int status, ret = 0; + int status, dirscan_flags = 0, ret = 0; sqfsdiff_t sd; memset(&sd, 0, sizeof(sd)); @@ -19,6 +19,9 @@ int main(int argc, char **argv) return 2; } + if (sd.compare_flags & COMPARE_TIMESTAMP) + dirscan_flags |= DIR_SCAN_READ_XATTR; + /* open first source */ sd.old_fd = open(sd.old_path, O_DIRECTORY | O_PATH | O_RDONLY); if (sd.old_fd < 0) { @@ -36,7 +39,8 @@ int main(int argc, char **argv) if (fstree_init(&sd.sqfs_old.fs, 512, NULL)) return 2; - if (fstree_from_dir(&sd.sqfs_old.fs, sd.old_path, 0)) { + if (fstree_from_dir(&sd.sqfs_old.fs, sd.old_path, + dirscan_flags)) { fstree_cleanup(&sd.sqfs_old.fs); return 2; } @@ -66,7 +70,8 @@ int main(int argc, char **argv) goto out_sqfs_old; } - if (fstree_from_dir(&sd.sqfs_new.fs, sd.new_path, 0)) { + if (fstree_from_dir(&sd.sqfs_new.fs, sd.new_path, + dirscan_flags)) { status = 2; fstree_cleanup(&sd.sqfs_old.fs); goto out_sqfs_old; |