Add define for Kirk Smith's USR Courier driver. Change default baud
[unix-history] / usr / src / usr.bin / mail / send.c
index c315374..69fb345 100644 (file)
@@ -1,8 +1,16 @@
-#
+/*
+ * Copyright (c) 1980 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ */
+
+#ifndef lint
+static char *sccsid = "@(#)send.c      5.2 (Berkeley) %G%";
+#endif not lint
 
 #include "rcv.h"
 #ifdef VMUNIX
 
 #include "rcv.h"
 #ifdef VMUNIX
-#include <wait.h>
+#include <sys/wait.h>
 #endif
 #include <ctype.h>
 #include <sys/stat.h>
 #endif
 #include <ctype.h>
 #include <sys/stat.h>
@@ -13,8 +21,6 @@
  * Mail to others.
  */
 
  * Mail to others.
  */
 
-static char *SccsId = "@(#)send.c      2.9 %G%";
-
 /*
  * Send message described by the passed pointer to the
  * passed output buffer.  Return -1 on error, but normally
 /*
  * Send message described by the passed pointer to the
  * passed output buffer.  Return -1 on error, but normally
@@ -256,15 +262,11 @@ mail1(hp)
        hp->h_seq = 1;
        if (hp->h_subject == NOSTR)
                hp->h_subject = sflag;
        hp->h_seq = 1;
        if (hp->h_subject == NOSTR)
                hp->h_subject = sflag;
-       if (fsize(mtf) == 0 && hp->h_subject == NOSTR) {
-               printf("No message !?!\n");
-               goto out;
-       }
        if (intty && value("askcc") != NOSTR)
                grabh(hp, GCC);
        else if (intty) {
                printf("EOT\n");
        if (intty && value("askcc") != NOSTR)
                grabh(hp, GCC);
        else if (intty) {
                printf("EOT\n");
-               flush();
+               fflush(stdout);
        }
 
        /*
        }
 
        /*
@@ -312,6 +314,9 @@ topdog:
        if (hp->h_seq > 0 && !remote) {
                fixhead(hp, to);
                if (fsize(mtf) == 0)
        if (hp->h_seq > 0 && !remote) {
                fixhead(hp, to);
                if (fsize(mtf) == 0)
+                   if (hp->h_subject == NOSTR)
+                       printf("No message, no subject; hope that's ok\n");
+                   else
                        printf("Null message body; hope that's ok\n");
                if ((mtf = infix(hp, mtf)) == NULL) {
                        fprintf(stderr, ". . . message lost, sorry.\n");
                        printf("Null message body; hope that's ok\n");
                if ((mtf = infix(hp, mtf)) == NULL) {
                        fprintf(stderr, ". . . message lost, sorry.\n");
@@ -342,7 +347,7 @@ topdog:
 #ifdef pdp11
        while (wait2(&s, WNOHANG) > 0)
 #endif
 #ifdef pdp11
        while (wait2(&s, WNOHANG) > 0)
 #endif
-#ifdef vax
+#if defined(vax) || defined(sun)
        while (wait3(&s, WNOHANG, 0) > 0)
 #endif
                ;
        while (wait3(&s, WNOHANG, 0) > 0)
 #endif
                ;