nmh-workers
[Top] [All Lists]

[Nmh-workers] Proposed solution to Debian Bug#143485

2005-08-25 16:40:42
Hi!

After discussing http://bugs.debian.org/143485 in detail a few month
ago and after discussing whether this is a vfork() issue, I finally had
the time to write a patch (attachment). Please have a look, whether this
seems sane (at least it fixes the original problem) and commit it to
CVS as you see fit. At the same time the workaround committed by 
Oliver Kiddle at 2005-05-18 should be removed.

Thanks, Harald

--- uip/replsbr.c.orig  2005-08-17 14:03:45.000000000 +0200
+++ uip/replsbr.c       2005-08-26 00:24:38.000000000 +0200
@@ -13,6 +13,7 @@
 #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;
@@ -247,6 +248,10 @@
      * 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",
@@ -413,6 +418,8 @@
 
 /*
  * Call the mhlproc
+ *
+ * This function expects that argument out has been fflushed by the caller.
  */
 
 static void
@@ -431,7 +438,6 @@
 
     rewind (in);
     lseek (fileno(in), (off_t) 0, SEEK_SET);
-    fflush (out);
 
     switch (pid = vfork ()) {
        case NOTOK: 
@@ -443,8 +449,9 @@
            closefds (3);
 
            execlp (mhlproc, mhl, "-form", filter, "-noclear", NULL);
-           fprintf (stderr, "unable to exec ");
-           perror (mhlproc);
+           write(2, "unable to exec ", 15);
+           write(2, mhlproc, strlen(mhlproc));
+           write(2, strerror(errno), strlen(strerror(errno)));
            _exit (-1);
 
        default: 
_______________________________________________
Nmh-workers mailing list
Nmh-workers@nongnu.org
http://lists.nongnu.org/mailman/listinfo/nmh-workers
<Prev in Thread] Current Thread [Next in Thread>