#include <h/addrsbr.h>
#include <h/fmt_scan.h>
#include <sys/file.h> /* L_SET */
+#include <errno.h>
extern short ccto; /* from repl.c */
extern short cccc;
* or add mhn directives
*/
if (filter) {
+ fflush(out);
+ if (ferror (out))
+ adios (drft, "error writing");
+
replfilter (inb, out, filter);
} else if (mime && mp) {
fprintf (out, "#forw [original message] +%s %s\n",
/*
* Call the mhlproc
+ *
+ * This function expects that argument out has been fflushed by the caller.
*/
static void
{
int pid;
char *mhl;
+ char *errstr;
if (filter == NULL)
return;
rewind (in);
lseek (fileno(in), (off_t) 0, SEEK_SET);
- fflush (out);
switch (pid = vfork ()) {
case NOTOK:
closefds (3);
execlp (mhlproc, mhl, "-form", filter, "-noclear", NULL);
- fprintf (stderr, "unable to exec ");
- perror (mhlproc);
+ errstr = strerror(errno);
+ write(2, "unable to exec ", 15);
+ write(2, mhlproc, strlen(mhlproc));
+ write(2, ": ", 2);
+ write(2, errstr, strlen(errstr));
+ write(2, "\n", 1);
_exit (-1);
default: