diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-09-14 17:57:58 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-09-14 18:06:04 +0200 |
commit | e165fb864fe86eda398a14713cf38924cc537adc (patch) | |
tree | 217b80d56b1d8c21f3387390db06e525b2f9f064 /lib/sqfshelper/data_reader.c | |
parent | f57814332a69bebc40e25e6537a3c08fc9e18f97 (diff) |
Remove fstree file flags
As a side effect, this requires the data writer to keep track of
statistics.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfshelper/data_reader.c')
-rw-r--r-- | lib/sqfshelper/data_reader.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/sqfshelper/data_reader.c b/lib/sqfshelper/data_reader.c index 6906933..42a351f 100644 --- a/lib/sqfshelper/data_reader.c +++ b/lib/sqfshelper/data_reader.c @@ -181,7 +181,8 @@ int data_reader_dump_file(data_reader_t *data, file_info_t *fi, int outfd, off_t off = fi->startblock; size_t i, diff; - if (fragsz != 0 && !(fi->flags & FILE_FLAG_HAS_FRAGMENT)) { + if (fragsz != 0 && (fi->fragment_offset >= data->block_size || + fi->fragment == 0xFFFFFFFF)) { fragsz = 0; ++count; } @@ -249,7 +250,8 @@ ssize_t data_reader_read(data_reader_t *data, file_info_t *fi, fragsz = fi->size % data->block_size; count = fi->size / data->block_size; - if (fragsz != 0 && !(fi->flags & FILE_FLAG_HAS_FRAGMENT)) { + if (fragsz != 0 && (fi->fragment_offset >= data->block_size || + fi->fragment == 0xFFFFFFFF)) { fragsz = 0; ++count; } |