filter via shell pipeline

Instead of requiring an executable, allow building arbitrary shell
pipelines to filter filetypes through.
This commit is contained in:
Grant Mathews 2015-12-09 20:56:07 -08:00 committed by Markus Teich
parent 11f2c648eb
commit 54daf38b08

4
sent.c
View File

@ -152,8 +152,8 @@ filter(int fd, const char *cmd)
dup2(fds[1], 1); dup2(fds[1], 1);
close(fds[0]); close(fds[0]);
close(fds[1]); close(fds[1]);
execlp(cmd, cmd, (char *)0); execlp("sh", "sh", "-c", cmd, (char *)0);
eprintf("execlp %s:", cmd); eprintf("execlp sh -c '%s':", cmd);
} }
close(fds[1]); close(fds[1]);
return fds[0]; return fds[0];