summaryrefslogtreecommitdiff
path: root/archivers/libarchive/files/libarchive/archive_write_set_compression_program.c
diff options
context:
space:
mode:
Diffstat (limited to 'archivers/libarchive/files/libarchive/archive_write_set_compression_program.c')
-rw-r--r--archivers/libarchive/files/libarchive/archive_write_set_compression_program.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/archivers/libarchive/files/libarchive/archive_write_set_compression_program.c b/archivers/libarchive/files/libarchive/archive_write_set_compression_program.c
index fc1481dbcd9..b8b20c86cf9 100644
--- a/archivers/libarchive/files/libarchive/archive_write_set_compression_program.c
+++ b/archivers/libarchive/files/libarchive/archive_write_set_compression_program.c
@@ -27,6 +27,23 @@
__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_compression_program.c,v 1.1 2007/05/29 01:00:19 kientzle Exp $");
+/* This capability is only available on POSIX systems. */
+#if !defined(HAVE_PIPE) || !defined(HAVE_VFORK) || !defined(HAVE_FCNTL)
+
+/*
+ * On non-Posix systems, allow the program to build, but choke if
+ * this function is actually invoked.
+ */
+int
+archive_write_set_compression_program(struct archive *_a, const char *cmd)
+{
+ archive_set_error(_a, -1,
+ "External compression programs not supported on this platform");
+ return (ARCHIVE_FATAL);
+}
+
+#else
+
#ifdef HAVE_SYS_WAIT_H
# include <sys/wait.h>
#endif
@@ -320,3 +337,5 @@ cleanup:
free(state);
return (ret);
}
+
+#endif /* !defined(HAVE_PIPE) || !defined(HAVE_VFORK) || !defined(HAVE_FCNTL) */