summaryrefslogtreecommitdiff
path: root/lib/fstree/mknode.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/fstree/mknode.c')
-rw-r--r--lib/fstree/mknode.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/fstree/mknode.c b/lib/fstree/mknode.c
index e0ab5b8..5a46a05 100644
--- a/lib/fstree/mknode.c
+++ b/lib/fstree/mknode.c
@@ -33,12 +33,6 @@ tree_node_t *fstree_mknode(tree_node_t *parent, const char *name,
if (n == NULL)
return NULL;
- if (parent != NULL) {
- n->next = parent->data.dir.children;
- parent->data.dir.children = n;
- n->parent = parent;
- }
-
n->xattr_idx = 0xFFFFFFFF;
n->uid = sb->st_uid;
n->gid = sb->st_gid;
@@ -81,6 +75,10 @@ tree_node_t *fstree_mknode(tree_node_t *parent, const char *name,
return NULL;
}
+ n->next = parent->data.dir.children;
+ parent->data.dir.children = n;
+ n->parent = parent;
+
parent->link_count++;
}