aboutsummaryrefslogtreecommitdiff
path: root/lib/libarchive/archive_write_set_compression_program.c
diff options
context:
space:
mode:
authorTim Kientzle <kientzle@FreeBSD.org>2008-06-15 10:45:57 +0000
committerTim Kientzle <kientzle@FreeBSD.org>2008-06-15 10:45:57 +0000
commit936d273c3ae5d1589b5789392b3603bed46af91c (patch)
tree9a91ef4fcb23000923100d4ae69479ce72a92b2a /lib/libarchive/archive_write_set_compression_program.c
parentdff2641a6754635e16a6b0f781071f87cfc90272 (diff)
Notes
Diffstat (limited to 'lib/libarchive/archive_write_set_compression_program.c')
-rw-r--r--lib/libarchive/archive_write_set_compression_program.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/libarchive/archive_write_set_compression_program.c b/lib/libarchive/archive_write_set_compression_program.c
index b910ef6b4ac3..3cd5c934205b 100644
--- a/lib/libarchive/archive_write_set_compression_program.c
+++ b/lib/libarchive/archive_write_set_compression_program.c
@@ -28,7 +28,9 @@
__FBSDID("$FreeBSD$");
/* 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
@@ -180,6 +182,12 @@ restart_write:
if (ret == -1 && errno != EAGAIN)
return (-1);
+ if (state->child_stdout == -1) {
+ fcntl(state->child_stdin, F_SETFL, 0);
+ __archive_check_child(state->child_stdin, state->child_stdout);
+ goto restart_write;
+ }
+
do {
ret = read(state->child_stdout,
state->child_buf + state->child_buf_avail,