diff options
Diffstat (limited to 'core')
| -rw-r--r-- | core/rdar.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/core/rdar.c b/core/rdar.c index 7cd53ef..2f7cea8 100644 --- a/core/rdar.c +++ b/core/rdar.c @@ -87,16 +87,18 @@ struct file_view { * file along with an offset to which it is located at * in the offset. * - * @magic: Format magic - * @path: File path - * @off: File data offset - * @flags: File flags + * @magic: Format magic + * @path: File path + * @off: File data offset + * @flags: File flags + * @length: File length in bytes */ struct data_desc { char magic[RDAR_MAGIC_LEN]; char path[RDAR_MAX_PATHLEN]; off_t off; uint16_t flags; + size_t length; }; /* @@ -248,12 +250,15 @@ static int idata_push_root(void) { struct idata_desc *root; + struct data_desc *desc; root = idata_from_file("%root%", true); if (root == NULL) { return -1; } + desc = &root->data; + desc->length = sizeof(struct root_data_region); IDATA_PUSH(root); return 0; } @@ -320,6 +325,7 @@ idata_table_flush(void) } d_desc->off = lseek(fd, 0, SEEK_CUR); + d_desc->length = view->length; write(fd, view->data, view->length); } |
