aboutsummaryrefslogtreecommitdiffstats
path: root/libarchive/archive_write_set_format_v7tar.c
diff options
context:
space:
mode:
Diffstat (limited to 'libarchive/archive_write_set_format_v7tar.c')
-rw-r--r--libarchive/archive_write_set_format_v7tar.c29
1 files changed, 5 insertions, 24 deletions
diff --git a/libarchive/archive_write_set_format_v7tar.c b/libarchive/archive_write_set_format_v7tar.c
index 1fdaafd2a939..599407144121 100644
--- a/libarchive/archive_write_set_format_v7tar.c
+++ b/libarchive/archive_write_set_format_v7tar.c
@@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$");
#include "archive_entry_locale.h"
#include "archive_private.h"
#include "archive_write_private.h"
+#include "archive_write_set_format_private.h"
struct v7tar {
uint64_t entry_bytes_remaining;
@@ -491,31 +492,11 @@ format_header_v7tar(struct archive_write *a, char h[512],
case AE_IFLNK:
h[V7TAR_typeflag_offset] = '2';
break;
- case AE_IFCHR:
- archive_set_error(&a->archive,
- ARCHIVE_ERRNO_FILE_FORMAT,
- "tar format cannot archive character device");
- return (ARCHIVE_FAILED);
- case AE_IFBLK:
- archive_set_error(&a->archive,
- ARCHIVE_ERRNO_FILE_FORMAT,
- "tar format cannot archive block device");
- return (ARCHIVE_FAILED);
- case AE_IFIFO:
- archive_set_error(&a->archive,
- ARCHIVE_ERRNO_FILE_FORMAT,
- "tar format cannot archive fifo");
- return (ARCHIVE_FAILED);
- case AE_IFSOCK:
- archive_set_error(&a->archive,
- ARCHIVE_ERRNO_FILE_FORMAT,
- "tar format cannot archive socket");
- return (ARCHIVE_FAILED);
default:
- archive_set_error(&a->archive,
- ARCHIVE_ERRNO_FILE_FORMAT,
- "tar format cannot archive this (mode=0%lo)",
- (unsigned long)archive_entry_mode(entry));
+ /* AE_IFBLK, AE_IFCHR, AE_IFIFO, AE_IFSOCK
+ * and unknown */
+ __archive_write_entry_filetype_unsupported(
+ &a->archive, entry, "v7tar");
ret = ARCHIVE_FAILED;
}
}