aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/squashfs.h2
-rw-r--r--mkfs/meta.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/include/squashfs.h b/include/squashfs.h
index 2d27cc1..e599863 100644
--- a/include/squashfs.h
+++ b/include/squashfs.h
@@ -13,6 +13,8 @@
#define SQFS_DEVBLK_SIZE 4096
#define SQFS_MAX_DIR_ENT 256
+#define SQFS_DIR_TYPE_MOD 8
+
typedef struct {
uint32_t magic;
uint32_t inode_count;
diff --git a/mkfs/meta.c b/mkfs/meta.c
index 4513733..7ee5dd4 100644
--- a/mkfs/meta.c
+++ b/mkfs/meta.c
@@ -121,7 +121,7 @@ static int write_dir(meta_writer_t *dm, dir_info_t *dir, dir_index_t **index)
for (i = 0; i < count; ++i) {
ent.offset = htole16(c->inode_ref & 0x0000FFFF);
ent.inode_number = htole16(c->inode_num - d->inode_num);
- ent.type = htole16(c->type);
+ ent.type = htole16(c->type % SQFS_DIR_TYPE_MOD);
ent.size = htole16(strlen(c->name) - 1);
dir->size += sizeof(ent) + strlen(c->name);