aboutsummaryrefslogtreecommitdiff
path: root/lib/io/src/unix/dir_iterator.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-05-20 17:04:15 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-05-22 16:15:45 +0200
commit6351872732fce77186f401050eee92c7c3aa3461 (patch)
treec938233378d13dbc94e08f24e34bb84406b08d21 /lib/io/src/unix/dir_iterator.c
parent9a97a9a4fe224bcf53ad23af31bca67bbb71a824 (diff)
libtar: add a dir_iterator_t implementation for tar files
The existing istream_t wrapper is mered into this one as well, we can open the files via the iterators open_file_ro function. Unit tests and tar2sqfs are modified accordingly. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/io/src/unix/dir_iterator.c')
-rw-r--r--lib/io/src/unix/dir_iterator.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/io/src/unix/dir_iterator.c b/lib/io/src/unix/dir_iterator.c
index fb7edae..7154ec9 100644
--- a/lib/io/src/unix/dir_iterator.c
+++ b/lib/io/src/unix/dir_iterator.c
@@ -118,6 +118,9 @@ static int dir_next(dir_iterator_t *base, dir_entry_t **out)
decoded->gid = it->sb.st_gid;
decoded->mode = it->sb.st_mode;
+ if (S_ISREG(it->sb.st_mode))
+ decoded->size = it->sb.st_size;
+
if (decoded->dev != it->device)
decoded->flags |= DIR_ENTRY_FLAG_MOUNT_POINT;