From: Michihiro NAKAJIMA Date: Wed, 3 Oct 2012 11:51:07 +0000 (+0900) Subject: Remove unnecessary build condition for a use of X-Git-Tag: v3.1.0~40^2~114 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36254e173ba8ff3895c4edee036f43fff185e1ea;p=thirdparty%2Flibarchive.git Remove unnecessary build condition for a use of __archive_create_child(). It has worked well on both POSIX system and non-POSIX system since libarchive 2.7.0. --- diff --git a/libarchive/archive_read_support_filter_program.c b/libarchive/archive_read_support_filter_program.c index b05eb0342..fe6048e89 100644 --- a/libarchive/archive_read_support_filter_program.c +++ b/libarchive/archive_read_support_filter_program.c @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include "archive.h" #include "archive_private.h" #include "archive_read_private.h" +#include "filter_fork.h" #if ARCHIVE_VERSION_NUMBER < 4000000 @@ -80,43 +81,6 @@ archive_read_support_filter_program(struct archive *a, const char *cmd) } -/* This capability is only available on POSIX systems. */ -#if (!defined(HAVE_PIPE) || !defined(HAVE_FCNTL) || \ - !(defined(HAVE_FORK) || defined(HAVE_VFORK))) && (!defined(_WIN32) || defined(__CYGWIN__)) - -/* - * On non-Posix systems, allow the program to build, but choke if - * this function is actually invoked. - */ -int -archive_read_support_filter_program_signature(struct archive *_a, - const char *cmd, const void *signature, size_t signature_len) -{ - (void)_a; /* UNUSED */ - (void)cmd; /* UNUSED */ - (void)signature; /* UNUSED */ - (void)signature_len; /* UNUSED */ - - archive_set_error(_a, -1, - "External compression programs not supported on this platform"); - return (ARCHIVE_FATAL); -} - -int -__archive_read_program(struct archive_read_filter *self, const char *cmd) -{ - (void)self; /* UNUSED */ - (void)cmd; /* UNUSED */ - - archive_set_error(&self->archive->archive, -1, - "External compression programs not supported on this platform"); - return (ARCHIVE_FATAL); -} - -#else - -#include "filter_fork.h" - /* * The bidder object stores the command and the signature to watch for. * The 'inhibit' entry here is used to ensure that unchecked filters never @@ -472,5 +436,3 @@ program_filter_close(struct archive_read_filter *self) return (e); } - -#endif /* !defined(HAVE_PIPE) || !defined(HAVE_VFORK) || !defined(HAVE_FCNTL) */ diff --git a/libarchive/archive_write_add_filter_program.c b/libarchive/archive_write_add_filter_program.c index d6ba783f4..778967003 100644 --- a/libarchive/archive_write_add_filter_program.c +++ b/libarchive/archive_write_add_filter_program.c @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_compression_program.c #include "archive.h" #include "archive_private.h" #include "archive_write_private.h" +#include "filter_fork.h" #if ARCHIVE_VERSION_NUMBER < 4000000 int @@ -55,26 +56,6 @@ archive_write_set_compression_program(struct archive *a, const char *cmd) } #endif -/* This capability is only available on POSIX systems. */ -#if (!defined(HAVE_PIPE) || !defined(HAVE_FCNTL) || \ - !(defined(HAVE_FORK) || defined(HAVE_VFORK))) && (!defined(_WIN32) || defined(__CYGWIN__)) - -/* - * On non-Posix systems, allow the program to build, but choke if - * this function is actually invoked. - */ -int -archive_write_add_filter_program(struct archive *_a, const char *cmd) -{ - archive_set_error(_a, -1, - "External compression programs not supported on this platform"); - return (ARCHIVE_FATAL); -} - -#else - -#include "filter_fork.h" - struct private_data { char *cmd; char *description; @@ -325,5 +306,3 @@ archive_compressor_program_free(struct archive_write_filter *f) f->data = NULL; return (ARCHIVE_OK); } - -#endif /* !defined(HAVE_PIPE) || !defined(HAVE_VFORK) || !defined(HAVE_FCNTL) */