Re: [PATCH 14/14] Use the asyncronous function infrastructure to run the content filter.
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Oct 14, 2007, 03:07 UTC
- Message-ID
- <Pine.LNX.4.64.0710140404480.25221@racer.site>
- In-Reply-To
- <1192305984-22594-15-git-send-email-johannes.sixt@telecom.at>
Hi,
On Sat, 13 Oct 2007, Johannes Sixt wrote:
> status = finish_command(&child_process);
> if (status)
> - error("external filter %s failed %d", cmd, -status);
> + error("external filter %s failed", params->cmd);Did you mean to remove the status from the output (it should probably read "(exit status %d)" instead of just "%d", but an exit status can help identify problems, right?
Show 14 quoted lines
> - child_process.pid = fork();
> - if (child_process.pid < 0) {
> - error("cannot fork to run external filter %s", cmd);
> - close(pipe_feed[0]);
> - close(pipe_feed[1]);
> - return NULL;
> - }
> - if (!child_process.pid) {
> - close(pipe_feed[0]);
> - exit(filter_buffer(pipe_feed[1], src, *sizep, cmd));
> - }
> - close(pipe_feed[1]);
> + if (start_async(&async))
> + return 0; /* error was already reported */Please write "return NULL;"
Thanks, Dscho