summaryrefslogtreecommitdiff
path: root/lib/sqfs/deserialize_fstree.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-06-19 13:21:52 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-06-19 15:17:52 +0200
commit19fbebec161c749e5bfe440e4514e2bc2d2ac3d4 (patch)
treeaac5d9442ec0979cd52e33332db29b8cd9edcf07 /lib/sqfs/deserialize_fstree.c
parent9864ea5b2045f4bd72633152d71dd1c7f8b0b7f9 (diff)
Cleanup fstree code
Replace default_$FIELD with a struct stat. Merge the rest of add_node/add_file into mknode and add by path+stat. Expose the mknode function and replace all the duplicated node pointer arithmetic magic with a call to mknode. Plus a generic cleanup by utlizing new util functions. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/deserialize_fstree.c')
-rw-r--r--lib/sqfs/deserialize_fstree.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/sqfs/deserialize_fstree.c b/lib/sqfs/deserialize_fstree.c
index 95dce98..2994007 100644
--- a/lib/sqfs/deserialize_fstree.c
+++ b/lib/sqfs/deserialize_fstree.c
@@ -158,10 +158,12 @@ int deserialize_fstree(fstree_t *out, sqfs_super_t *super, compressor_t *cmp,
memset(out, 0, sizeof(*out));
out->block_size = super->block_size;
- out->default_uid = 0;
- out->default_gid = 0;
- out->default_mode = 0755;
- out->default_mtime = super->modification_time;
+ out->defaults.st_uid = 0;
+ out->defaults.st_gid = 0;
+ out->defaults.st_mode = 0755;
+ out->defaults.st_mtime = super->modification_time;
+ out->defaults.st_ctime = super->modification_time;
+ out->defaults.st_atime = super->modification_time;
out->root = tree_node_from_inode(root, &idtbl, "", super->block_size);
free(root);