nmh-workers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Harald Geyer
Subject: [Nmh-workers] Proposed solution to Debian Bug#143485
Date: Fri, 26 Aug 2005 01:39:55 +0200

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: 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]