]> git.ipfire.org Git - thirdparty/git.git/blobdiff - convert.c
run-command: support custom fd-set in async
[thirdparty/git.git] / convert.c
index 491e7141b4ea29b3cf754cbaf2656a0c3ca8c46c..e70ee094a76d850cd655338d406a7c4efc37c7d5 100644 (file)
--- a/convert.c
+++ b/convert.c
@@ -241,7 +241,7 @@ struct filter_params {
        const char *cmd;
 };
 
-static int filter_buffer(int fd, void *data)
+static int filter_buffer(int in, int out, void *data)
 {
        /*
         * Spawn cmd and feed the buffer contents through its stdin.
@@ -254,7 +254,7 @@ static int filter_buffer(int fd, void *data)
        memset(&child_process, 0, sizeof(child_process));
        child_process.argv = argv;
        child_process.in = -1;
-       child_process.out = fd;
+       child_process.out = out;
 
        if (start_command(&child_process))
                return error("cannot fork to run external filter %s", params->cmd);
@@ -291,6 +291,7 @@ static int apply_filter(const char *path, const char *src, size_t len,
        memset(&async, 0, sizeof(async));
        async.proc = filter_buffer;
        async.data = &params;
+       async.out = -1;
        params.src = src;
        params.size = len;
        params.cmd = cmd;