- union block buf;
-
- status = read (fd, &buf, sizeof buf);
- if (status != sizeof buf)
- {
- archive_read_error ();
- FATAL_ERROR ((0, 0, _("Quitting now.")));
- }
-
- lseek (fd, 0, SEEK_SET); /* This will fail if fd==0, but that does not
- matter, since we do not handle compressed
- stdin anyway */
-
- if (tar_checksum (&buf) == HEADER_SUCCESS)
+ bool sfr, srp;
+
+ /* Prepare global data needed for find_next_block: */
+ record_end = record_start; /* set up for 1st record = # 0 */
+ sfr = read_full_records;
+ read_full_records = true; /* Suppress fatal error on reading a partial
+ record */
+ srp = reading_from_pipe;
+ reading_from_pipe = true; /* Suppress warning message on reading a partial
+ record */
+ find_next_block ();
+
+ /* Restore global values */
+ read_full_records = sfr;
+ reading_from_pipe = srp;
+
+ if (tar_checksum (record_start) == HEADER_SUCCESS)