&& S_IROTH == TOREAD && S_IWOTH == TOWRITE && S_IXOTH == TOEXEC
&& archive_format != POSIX_FORMAT
&& archive_format != USTAR_FORMAT
- && archive_format != GNU_FORMAT
- && archive_format != OLDGNU_FORMAT)
+ && archive_format != GNU_FORMAT)
{
negative = v < 0;
u = v;
quotearg_colon (st->orig_file_name),
STRINGIFY_BIGINT (size_left, buf)));
if (! ignore_failed_read_option)
- exit_status = TAREXIT_DIFFERS;
+ set_exit_status (TAREXIT_DIFFERS);
pad_archive (size_left - (bufsize - count));
return dump_status_short;
}
write_eot ();
close_archive ();
-
+ finish_deferred_unlinks ();
if (listed_incremental_option)
write_directory_file ();
}
(0, 0, _("%s: Unknown file type; file ignored"),
quotearg_colon (p)));
if (!ignore_failed_read_option)
- exit_status = TAREXIT_FAILURE;
+ set_exit_status (TAREXIT_FAILURE);
}
\f
blk->header.typeflag = LNKTYPE;
finish_header (st, blk, block_ordinal);
- if (remove_files_option && unlink (st->orig_file_name) != 0)
- unlink_error (st->orig_file_name);
+ if (remove_files_option)
+ queue_deferred_unlink (st->orig_file_name, false);
return true;
}
WARNOPT (WARN_FILE_CHANGED,
(0, 0, _("%s: file changed as we read it"),
quotearg_colon (p)));
- if (exit_status == TAREXIT_SUCCESS)
- exit_status = TAREXIT_DIFFERS;
+ set_exit_status (TAREXIT_DIFFERS);
}
else if (atime_preserve_option == replace_atime_preserve
&& set_file_atime (fd, p, restore_times) != 0)
}
if (ok && remove_files_option)
- {
- if (is_dir)
- {
- if (rmdir (p) != 0 && errno != ENOTEMPTY)
- rmdir_error (p);
- }
- else
- {
- if (unlink (p) != 0)
- unlink_error (p);
- }
- }
+ queue_deferred_unlink (p, is_dir);
return;
}
/* nothing more to do to it */
if (remove_files_option)
- {
- if (unlink (p) == -1)
- unlink_error (p);
- }
+ queue_deferred_unlink (p, false);
+
file_count_links (st);
return;
}
finish_header (st, header, block_ordinal);
if (remove_files_option)
- {
- if (unlink (p) == -1)
- unlink_error (p);
- }
+ queue_deferred_unlink (p, false);
}
void