From: Joerg Sonnenberger Date: Tue, 27 May 2008 10:14:43 +0000 (-0400) Subject: Some systems don't have vfork, only fork. It is good enough for X-Git-Tag: v2.6.0~196 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4c027a20358003dc599d5accc5642592101679e4;p=thirdparty%2Flibarchive.git Some systems don't have vfork, only fork. It is good enough for our purposes, so use either. Include archive.h if the program support is not present to fix compilation. SVN-Revision: 96 --- diff --git a/configure.ac b/configure.ac index 405490bd2..c84093567 100644 --- a/configure.ac +++ b/configure.ac @@ -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]) diff --git a/libarchive/archive_read_support_compression_program.c b/libarchive/archive_read_support_compression_program.c index d3da22259..9d3e2d035 100644 --- a/libarchive/archive_read_support_compression_program.c +++ b/libarchive/archive_read_support_compression_program.c @@ -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 diff --git a/libarchive/archive_write_set_compression_program.c b/libarchive/archive_write_set_compression_program.c index c1b099358..59be73a8c 100644 --- a/libarchive/archive_write_set_compression_program.c +++ b/libarchive/archive_write_set_compression_program.c @@ -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 diff --git a/libarchive/filter_fork.c b/libarchive/filter_fork.c index a097e6986..58a7ab48b 100644 --- a/libarchive/filter_fork.c +++ b/libarchive/filter_fork.c @@ -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: