summaryrefslogtreecommitdiff
path: root/lib/sqfshelper/serialize_fstree.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-29 02:41:50 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-29 02:41:50 +0200
commit064258c7bb285163fe2deabe411e39c2b9d1e755 (patch)
tree672e27143504695920dd12f2a26ccb6f49a4cb80 /lib/sqfshelper/serialize_fstree.c
parent318d14cabf4e29373006e04ee855f9583b0ce3a5 (diff)
Fix inode numbering: always start with 1, use 0 as parent for the root
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfshelper/serialize_fstree.c')
-rw-r--r--lib/sqfshelper/serialize_fstree.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sqfshelper/serialize_fstree.c b/lib/sqfshelper/serialize_fstree.c
index 9a122ac..54157ac 100644
--- a/lib/sqfshelper/serialize_fstree.c
+++ b/lib/sqfshelper/serialize_fstree.c
@@ -37,7 +37,7 @@ static sqfs_inode_generic_t *write_dir_entries(sqfs_dir_writer_t *dirw,
return NULL;
xattr = node->xattr_idx;
- parent_inode = (node->parent == NULL) ? 1 : node->parent->inode_num;
+ parent_inode = (node->parent == NULL) ? 0 : node->parent->inode_num;
inode = sqfs_dir_writer_create_inode(dirw, 0, xattr, parent_inode);
if (inode == NULL) {
@@ -87,7 +87,7 @@ int sqfs_serialize_fstree(sqfs_file_t *file, sqfs_super_t *super, fstree_t *fs,
super->inode_table_start = file->get_size(file);
- for (i = 2; i < fs->inode_tbl_size; ++i) {
+ for (i = 0; i < fs->inode_tbl_size; ++i) {
if (S_ISDIR(fs->inode_table[i]->mode)) {
inode = write_dir_entries(dirwr, fs->inode_table[i],
idtbl);