+2005-10-05 Oliver Kiddle <okiddle@yahoo.co.uk>
+
+ * Harald Geyer: h/mh.h, uip/replsbr.c: back out previous change
+ (fork/vfork) and replace with code that handles the issue directly
+
2005-05-18 Oliver Kiddle <okiddle@yahoo.co.uk>
* Debian Bug# 143485: Nick Rusnov: h/mh.h: use fork instead of
#include <h/nmh.h>
-/* A quick fix for Linux systems. According to the vfork manual page,
- there is little difference in performance, so we aren't losing much.
- But this fixes a minor message bug so why not? On NetBSD, this should
- probably not happen. */
-#ifdef linux
-#define vfork fork
-#endif
-
-
/*
* Well-used constants
*/
#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: