diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2023-06-10 17:51:03 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2023-06-10 17:56:27 +0200 |
commit | ad1691aa33cfc1b1558ce10e93552d0eb1cdcd63 (patch) | |
tree | 8c53c5cd0202ed638e9c45d1eaece8e486f17a0c /lib/tar | |
parent | 605fd3e3a2656438dc0283699fc4a4b44b8b71db (diff) |
libio: add desired read size to istream_get_buffered_data
This properly maps to all of our use cases and makes istream_precache
obsolete.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/tar')
-rw-r--r-- | lib/tar/src/iterator.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/tar/src/iterator.c b/lib/tar/src/iterator.c index 66b5dfc..f46a9c2 100644 --- a/lib/tar/src/iterator.c +++ b/lib/tar/src/iterator.c @@ -132,7 +132,7 @@ static int strm_precache(istream_t *strm) int ret; ret = istream_get_buffered_data(tar->parent->stream, - &strm->buffer, &avail); + &strm->buffer, &avail, diff); if (ret > 0) goto fail_borked; if (ret < 0) @@ -373,11 +373,8 @@ dir_iterator_t *tar_open_stream(istream_t *strm) it->read_xattr = it_read_xattr; /* proble if the stream is compressed */ - ret = istream_precache(strm); - if (ret != 0) - goto out_strm; - - ret = istream_get_buffered_data(strm, &ptr, &size); + ret = istream_get_buffered_data(strm, &ptr, &size, + sizeof(tar_header_t)); if (ret != 0) goto out_strm; |