]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Some systems don't have vfork, only fork. It is good enough for
authorJoerg Sonnenberger <joerg.sonnenberger@gmail.com>
Tue, 27 May 2008 10:14:43 +0000 (06:14 -0400)
committerJoerg Sonnenberger <joerg.sonnenberger@gmail.com>
Tue, 27 May 2008 10:14:43 +0000 (06:14 -0400)
our purposes, so use either.
Include archive.h if the program support is not present to fix
compilation.

SVN-Revision: 96

configure.ac
libarchive/archive_read_support_compression_program.c
libarchive/archive_write_set_compression_program.c
libarchive/filter_fork.c

index 405490bd23f19425c8b8025da224717594e7320f..c84093567b6139d885b40a1d378075609814fdee 100644 (file)
@@ -239,8 +239,8 @@ AC_FUNC_STAT
 AC_FUNC_STRERROR_R
 AC_FUNC_STRFTIME
 AC_FUNC_VPRINTF
-AC_CHECK_FUNCS([chflags chown fchdir fchflags fchmod fchown fcntl fstat])
-AC_CHECK_FUNCS([ftruncate futimes geteuid getopt_long getpid])
+AC_CHECK_FUNCS([chflags chown fchdir fchflags fchmod fchown fcntl fork])
+AC_CHECK_FUNCS([fstat ftruncate futimes geteuid getopt_long getpid])
 AC_CHECK_FUNCS([lchflags lchmod lchown])
 AC_CHECK_FUNCS([lutimes memmove memset mkdir mkfifo mknod])
 AC_CHECK_FUNCS([nl_langinfo pipe poll select setenv setlocale])
index d3da222592b571fc0ee8a646130db19afbb1c4c4..9d3e2d0351587616f46b006fe033ca8b2dd8f515 100644 (file)
@@ -28,7 +28,8 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_compression_program.
 
 
 /* This capability is only available on POSIX systems. */
-#if !defined(HAVE_PIPE) || !defined(HAVE_VFORK) || !defined(HAVE_FCNTL)
+#if !defined(HAVE_PIPE) || !defined(HAVE_FCNTL) || \
+    !(defined(HAVE_FORK) || defined(HAVE_VFORK))
 
 /*
  * On non-Posix systems, allow the program to build, but choke if
index c1b099358dac64a4b483eb33a7ee0e91bd17eadc..59be73a8c18422ae00f77ee2c78e4eaf5665ef18 100644 (file)
@@ -28,7 +28,9 @@
 __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)
+#if !defined(HAVE_PIPE) || !defined(HAVE_FCNTL) || \
+    !(defined(HAVE_FORK) || defined(HAVE_VFORK))
+#include "archive.h"
 
 /*
  * On non-Posix systems, allow the program to build, but choke if
index a097e6986f6bf30cad9eb0685bf59b5f958b1b48..58a7ab48b9f2a8f5b0a998c2ade9a94bd8aeabf3 100644 (file)
@@ -26,7 +26,8 @@
 #include "archive_platform.h"
 
 /* This capability is only available on POSIX systems. */
-#if defined(HAVE_PIPE) && defined(HAVE_VFORK) && defined(HAVE_FCNTL)
+#if defined(HAVE_PIPE) && defined(HAVE_FCNTL) && \
+    (defined(HAVE_FORK) || defined(HAVE_VFORK))
 
 __FBSDID("$FreeBSD: src/lib/libarchive/filter_fork.c,v 1.2 2007/12/30 04:58:22 kientzle Exp $");
 
@@ -75,7 +76,11 @@ __archive_create_child(const char *path, int *child_stdin, int *child_stdout)
                stdout_pipe[1] = tmp;
        }
 
+#if HAVE_VFORK
        switch ((child = vfork())) {
+#else
+       switch ((child = fork())) {
+#endif
        case -1:
                goto stdout_opened;
        case 0: