aboutsummaryrefslogtreecommitdiff
path: root/difftool/node_compare.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-08-21 14:04:43 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-08-21 14:04:43 +0200
commit4ff2b4f689f4e530b6c6f3eed17a595f7ccf56fb (patch)
tree1e453c616d34a1547eb8e62949337e8361c6b31e /difftool/node_compare.c
parent5cbc1267e5dc42149eeb07883f5f6239d22388e9 (diff)
Isolate sqfsdiff global state and split off option processing
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'difftool/node_compare.c')
-rw-r--r--difftool/node_compare.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/difftool/node_compare.c b/difftool/node_compare.c
index 1c68ab2..35fd07b 100644
--- a/difftool/node_compare.c
+++ b/difftool/node_compare.c
@@ -6,7 +6,7 @@
*/
#include "sqfsdiff.h"
-int node_compare(tree_node_t *a, tree_node_t *b)
+int node_compare(sqfsdiff_t *sd, tree_node_t *a, tree_node_t *b)
{
char *path = node_path(a);
tree_node_t *ait, *bit;
@@ -21,7 +21,7 @@ int node_compare(tree_node_t *a, tree_node_t *b)
return 1;
}
- if (!(compare_flags & COMPARE_NO_PERM)) {
+ if (!(sd->compare_flags & COMPARE_NO_PERM)) {
if ((a->mode & ~S_IFMT) != (b->mode & ~S_IFMT)) {
fprintf(stdout, "%s has different permissions\n",
path);
@@ -29,21 +29,21 @@ int node_compare(tree_node_t *a, tree_node_t *b)
}
}
- if (!(compare_flags & COMPARE_NO_OWNER)) {
+ if (!(sd->compare_flags & COMPARE_NO_OWNER)) {
if (a->uid != b->uid || a->gid != b->gid) {
fprintf(stdout, "%s has different ownership\n", path);
status = 1;
}
}
- if (compare_flags & COMPARE_TIMESTAMP) {
+ if (sd->compare_flags & COMPARE_TIMESTAMP) {
if (a->mod_time != b->mod_time) {
fprintf(stdout, "%s has a different timestamp\n", path);
status = 1;
}
}
- if (compare_flags & COMPARE_INODE_NUM) {
+ if (sd->compare_flags & COMPARE_INODE_NUM) {
if (a->inode_num != b->inode_num) {
fprintf(stdout, "%s has a different inode number\n",
path);
@@ -85,7 +85,7 @@ int node_compare(tree_node_t *a, tree_node_t *b)
bit = b->data.dir->children;
while (ait != NULL && bit != NULL) {
- ret = node_compare(ait, bit);
+ ret = node_compare(sd, ait, bit);
if (ret < 0)
return -1;
if (ret > 0)
@@ -96,7 +96,7 @@ int node_compare(tree_node_t *a, tree_node_t *b)
}
break;
case S_IFREG:
- ret = compare_files(a->data.file, b->data.file, path);
+ ret = compare_files(sd, a->data.file, b->data.file, path);
if (ret < 0) {
status = -1;
} else if (ret > 0) {