Merge r1021 from libarchive.googlecode.com:

If we know it's a socket, say so.
This commit is contained in:
Tim Kientzle 2009-04-27 18:35:03 +00:00
parent 7ad21ca8c3
commit d906209e53
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=191579
2 changed files with 14 additions and 2 deletions

View File

@ -452,8 +452,14 @@ archive_write_pax_header(struct archive_write *a,
free(t); free(t);
} }
break; break;
case AE_IFSOCK:
archive_set_error(&a->archive,
ARCHIVE_ERRNO_FILE_FORMAT,
"tar format cannot archive socket");
return (ARCHIVE_WARN);
default: default:
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, archive_set_error(&a->archive,
ARCHIVE_ERRNO_FILE_FORMAT,
"tar format cannot archive this (type=0%lo)", "tar format cannot archive this (type=0%lo)",
(unsigned long)archive_entry_filetype(entry_original)); (unsigned long)archive_entry_filetype(entry_original));
return (ARCHIVE_WARN); return (ARCHIVE_WARN);

View File

@ -414,8 +414,14 @@ __archive_write_format_header_ustar(struct archive_write *a, char h[512],
case AE_IFBLK: h[USTAR_typeflag_offset] = '4' ; break; case AE_IFBLK: h[USTAR_typeflag_offset] = '4' ; break;
case AE_IFDIR: h[USTAR_typeflag_offset] = '5' ; break; case AE_IFDIR: h[USTAR_typeflag_offset] = '5' ; break;
case AE_IFIFO: h[USTAR_typeflag_offset] = '6' ; break; case AE_IFIFO: h[USTAR_typeflag_offset] = '6' ; break;
case AE_IFSOCK:
archive_set_error(&a->archive,
ARCHIVE_ERRNO_FILE_FORMAT,
"tar format cannot archive socket");
return (ARCHIVE_FAILED);
default: default:
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, archive_set_error(&a->archive,
ARCHIVE_ERRNO_FILE_FORMAT,
"tar format cannot archive this (mode=0%lo)", "tar format cannot archive this (mode=0%lo)",
(unsigned long)archive_entry_mode(entry)); (unsigned long)archive_entry_mode(entry));
ret = ARCHIVE_FAILED; ret = ARCHIVE_FAILED;