73 |
static int checkpoint; |
static int checkpoint; |
74 |
|
|
75 |
static bool read_full_records = false; |
static bool read_full_records = false; |
|
static bool reading_from_pipe = false; |
|
76 |
|
|
77 |
/* We're reading, but we just read the last block and it's time to update. |
/* We're reading, but we just read the last block and it's time to update. |
78 |
Declared in update.c |
Declared in update.c |
181 |
check_compressed_archive () |
check_compressed_archive () |
182 |
{ |
{ |
183 |
struct zip_magic const *p; |
struct zip_magic const *p; |
184 |
bool sfr, srp; |
bool sfr; |
185 |
|
|
186 |
/* Prepare global data needed for find_next_block: */ |
/* Prepare global data needed for find_next_block: */ |
187 |
record_end = record_start; /* set up for 1st record = # 0 */ |
record_end = record_start; /* set up for 1st record = # 0 */ |
188 |
sfr = read_full_records; |
sfr = read_full_records; |
189 |
read_full_records = true; /* Suppress fatal error on reading a partial |
read_full_records = true; /* Suppress fatal error on reading a partial |
190 |
record */ |
record */ |
|
srp = reading_from_pipe; |
|
|
reading_from_pipe = true; /* Suppress warning message on reading a partial |
|
|
record */ |
|
191 |
find_next_block (); |
find_next_block (); |
192 |
|
|
193 |
/* Restore global values */ |
/* Restore global values */ |
194 |
read_full_records = sfr; |
read_full_records = sfr; |
|
reading_from_pipe = srp; |
|
195 |
|
|
196 |
if (tar_checksum (record_start, true) == HEADER_SUCCESS) |
if (tar_checksum (record_start, true) == HEADER_SUCCESS) |
197 |
/* Probably a valid header */ |
/* Probably a valid header */ |
231 |
/* Open compressed archive */ |
/* Open compressed archive */ |
232 |
use_compress_program_option = compress_program (type); |
use_compress_program_option = compress_program (type); |
233 |
child_pid = sys_child_open_for_uncompress (); |
child_pid = sys_child_open_for_uncompress (); |
234 |
read_full_records = reading_from_pipe = true; |
read_full_records = true; |
235 |
} |
} |
236 |
|
|
237 |
records_read = 0; |
records_read = 0; |
401 |
access_mode = wanted_access == ACCESS_UPDATE ? ACCESS_READ : wanted_access; |
access_mode = wanted_access == ACCESS_UPDATE ? ACCESS_READ : wanted_access; |
402 |
|
|
403 |
read_full_records = read_full_records_option; |
read_full_records = read_full_records_option; |
|
reading_from_pipe = false; |
|
404 |
|
|
405 |
records_read = 0; |
records_read = 0; |
406 |
|
|
410 |
{ |
{ |
411 |
case ACCESS_READ: |
case ACCESS_READ: |
412 |
child_pid = sys_child_open_for_uncompress (); |
child_pid = sys_child_open_for_uncompress (); |
413 |
read_full_records = reading_from_pipe = true; |
read_full_records = true; |
414 |
record_end = record_start; /* set up for 1st record = # 0 */ |
record_end = record_start; /* set up for 1st record = # 0 */ |
415 |
break; |
break; |
416 |
|
|
754 |
archive_read_error (); |
archive_read_error (); |
755 |
|
|
756 |
if (status == 0) |
if (status == 0) |
757 |
{ |
break; |
|
if (!reading_from_pipe) |
|
|
{ |
|
|
char buf[UINTMAX_STRSIZE_BOUND]; |
|
|
|
|
|
WARN((0, 0, |
|
|
ngettext ("Read %s byte from %s", |
|
|
"Read %s bytes from %s", |
|
|
record_size - left), |
|
|
STRINGIFY_BIGINT (record_size - left, buf), |
|
|
*archive_name_cursor)); |
|
|
} |
|
|
break; |
|
|
} |
|
758 |
|
|
759 |
if (! read_full_records) |
if (! read_full_records) |
760 |
{ |
{ |