Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:GA
tar.10815
tar-1.27-revert-optimize-c-sparse.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File tar-1.27-revert-optimize-c-sparse.patch of Package tar.10815
--- src/sparse.c | 54 ++++++++++++++++++++++++++---------------------------- 1 file changed, 26 insertions(+), 28 deletions(-) --- a/src/sparse.c +++ b/src/sparse.c @@ -215,45 +215,43 @@ sparse_scan_file (struct tar_sparse_file struct tar_stat_info *st = file->stat_info; int fd = file->fd; char buffer[BLOCKSIZE]; - size_t count = 0; + size_t count; off_t offset = 0; struct sp_array sp = {0, 0}; + if (!lseek_or_error (file, 0)) + return false; + st->archive_file_size = 0; - if (ST_NBLOCKS (st->stat) == 0) - offset = st->stat.st_size; - else - { - if (!tar_sparse_scan (file, scan_begin, NULL)) - return false; + if (!tar_sparse_scan (file, scan_begin, NULL)) + return false; - while ((count = blocking_read (fd, buffer, sizeof buffer)) != 0 - && count != SAFE_READ_ERROR) + while ((count = blocking_read (fd, buffer, sizeof buffer)) != 0 + && count != SAFE_READ_ERROR) + { + /* Analyze the block. */ + if (zero_block_p (buffer, count)) { - /* Analyze the block. */ - if (zero_block_p (buffer, count)) - { - if (sp.numbytes) - { - sparse_add_map (st, &sp); - sp.numbytes = 0; - if (!tar_sparse_scan (file, scan_block, NULL)) - return false; - } - } - else + if (sp.numbytes) { - if (sp.numbytes == 0) - sp.offset = offset; - sp.numbytes += count; - st->archive_file_size += count; - if (!tar_sparse_scan (file, scan_block, buffer)) + sparse_add_map (st, &sp); + sp.numbytes = 0; + if (!tar_sparse_scan (file, scan_block, NULL)) return false; } - - offset += count; } + else + { + if (sp.numbytes == 0) + sp.offset = offset; + sp.numbytes += count; + st->archive_file_size += count; + if (!tar_sparse_scan (file, scan_block, buffer)) + return false; + } + + offset += count; } if (sp.numbytes == 0)
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor