Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Drop the exec filter's close steps that do nothing
A filter is only closed after an open has forked it, so its pid is a
child's, and every open writes its arguments into argv afresh.
Diffstat (limited to '')
| -rw-r--r-- | source/filter.c | 8 |
1 file changed, 1 insertion, 7 deletions
diff --git a/source/filter.c b/source/filter.c index 76cebe9..a0d5990 100644 --- a/source/filter.c +++ b/source/filter.c @@ -64,22 +64,16 @@ static int open_exec_filter(struct cgit_filter *base, va_list ap) static int close_exec_filter(struct cgit_filter *base) { struct cgit_exec_filter *filter = (struct cgit_exec_filter *)base; - int i, exit_status = 0; + int exit_status = 0; running_exec = NULL; cgit_die_unless_non_negative(dup2(filter->old_stdout, STDOUT_FILENO), "Unable to restore stdout"); close(filter->old_stdout); - if (filter->pid < 0) - goto done; waitpid(filter->pid, &exit_status, 0); if (!WIFEXITED(exit_status)) die("Subprocess %s exited abnormally", filter->cmd); if (WEXITSTATUS(exit_status) == EXEC_FAILED) die("Unable to run filter %s", filter->cmd); - -done: - for (i = 0; i < filter->base.argument_count; i++) - filter->argv[i + 1] = NULL; return WEXITSTATUS(exit_status); } |
