test/report error writing to stdout
[mmh] / uip / mhlsbr.c
index 68d0835..c310e2a 100644 (file)
@@ -3,13 +3,17 @@
  * mhlsbr.c -- main routines for nmh message lister
  *
  * $Id$
+ *
+ * This code is Copyright (c) 2002, by the authors of nmh.  See the
+ * COPYRIGHT file in the root directory of the nmh distribution for
+ * complete copyright information.
  */
 
 #include <h/mh.h>
 #include <h/signals.h>
 #include <h/addrsbr.h>
 #include <h/fmt_scan.h>
-#include <zotnet/tws/tws.h>
+#include <h/tws.h>
 #include <setjmp.h>
 #include <signal.h>
 
@@ -72,7 +76,7 @@ static struct swit mhlswitches[] = {
 #define VERSIONSW     15
     { "version", 0 },
 #define        HELPSW        16
-    { "help", 4 },
+    { "help", 0 },
 #define        FORW1SW       17
     { "forward", -7 },         /* interface from forw */
 #define        FORW2SW       18
@@ -476,6 +480,11 @@ mhl (int argc, char **argv)
                    vecp > 1 ? "s" : "");
     }
 
+    fflush(stdout);
+    if(ferror(stdout)){
+           adios("output", "error writing");
+    }
+    
     if (clearflg > 0 && ontty == NOTTY)
        clear_screen ();