Move a static variable into struct archive_write_disk, which is a safe
location from a thread perspective.
Only create and use it if it's really needed, i.e. for systems which
lack support for extended attributes.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
int stream_valid;
int decmpfs_compression_level;
#endif
+#if !(ARCHIVE_XATTR_LINUX || ARCHIVE_XATTR_DARWIN || ARCHIVE_XATTR_AIX ||\
+ ARCHIVE_XATTR_FREEBSD)
+ int warning_done;
+#endif
};
/*
static int
set_xattrs(struct archive_write_disk *a)
{
- static int warning_done = 0;
-
/* If there aren't any extended attributes, then it's okay not
* to extract them, otherwise, issue a single warning. */
- if (archive_entry_xattr_count(a->entry) != 0 && !warning_done) {
- warning_done = 1;
+ if (archive_entry_xattr_count(a->entry) != 0 && !a->warning_done) {
+ a->warning_done = 1;
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Cannot restore extended attributes on this system");
return (ARCHIVE_WARN);