aboutsummaryrefslogtreecommitdiffstats
path: root/libarchive/archive_write_add_filter_program.c
diff options
context:
space:
mode:
Diffstat (limited to 'libarchive/archive_write_add_filter_program.c')
-rw-r--r--libarchive/archive_write_add_filter_program.c26
1 files changed, 4 insertions, 22 deletions
diff --git a/libarchive/archive_write_add_filter_program.c b/libarchive/archive_write_add_filter_program.c
index a4bc1d90eda8..c096e7227ba4 100644
--- a/libarchive/archive_write_add_filter_program.c
+++ b/libarchive/archive_write_add_filter_program.c
@@ -196,10 +196,6 @@ __archive_write_program_free(struct archive_write_program_data *data)
{
if (data) {
-#if defined(_WIN32) && !defined(__CYGWIN__)
- if (data->child)
- CloseHandle(data->child);
-#endif
free(data->program_name);
free(data->child_buf);
free(data);
@@ -211,7 +207,7 @@ int
__archive_write_program_open(struct archive_write_filter *f,
struct archive_write_program_data *data, const char *cmd)
{
- pid_t child;
+ int ret;
if (data->child_buf == NULL) {
data->child_buf_len = 65536;
@@ -225,27 +221,13 @@ __archive_write_program_open(struct archive_write_filter *f,
}
}
- child = __archive_create_child(cmd, &data->child_stdin,
- &data->child_stdout);
- if (child == -1) {
+ ret = __archive_create_child(cmd, &data->child_stdin,
+ &data->child_stdout, &data->child);
+ if (ret != ARCHIVE_OK) {
archive_set_error(f->archive, EINVAL,
"Can't launch external program: %s", cmd);
return (ARCHIVE_FATAL);
}
-#if defined(_WIN32) && !defined(__CYGWIN__)
- data->child = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, child);
- if (data->child == NULL) {
- close(data->child_stdin);
- data->child_stdin = -1;
- close(data->child_stdout);
- data->child_stdout = -1;
- archive_set_error(f->archive, EINVAL,
- "Can't launch external program: %s", cmd);
- return (ARCHIVE_FATAL);
- }
-#else
- data->child = child;
-#endif
return (ARCHIVE_OK);
}