X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Frepl.c;h=71ae98e74f62e998565144fa8368684d8bcfc385;hp=f5df9ecbaa43833db04ef6d29b9ceeca1bb18557;hb=e9df3f1a429daaca00025e76ce8850d104311ee1;hpb=27f39f1e62375fdd22f4cecab4883b0ad764b361 diff --git a/uip/repl.c b/uip/repl.c index f5df9ec..71ae98e 100644 --- a/uip/repl.c +++ b/uip/repl.c @@ -740,7 +740,8 @@ insert(struct mailname *np) static void replfilter(FILE *in, FILE *out, char *filter) { - int pid, n; + int pid, pid_show, n; + int mailpipe[2]; char *errstr; if (filter == NULL) @@ -752,12 +753,32 @@ replfilter(FILE *in, FILE *out, char *filter) rewind(in); lseek(fileno(in), (off_t) 0, SEEK_SET); - switch (pid = fork()) { + if (pipe(mailpipe) == -1) { + adios(EX_OSERR, "pipe", "can't create pipe"); + } + + switch (pid_show = fork()) { case NOTOK: adios(EX_OSERR, "fork", "unable to"); case OK: dup2(fileno(in), fileno(stdin)); + dup2(mailpipe[1], fileno(stdout)); + for (n=3; n