fsync queue files
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Sun, 30 May 1993 23:54:49 +0000 (15:54 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Sun, 30 May 1993 23:54:49 +0000 (15:54 -0800)
SCCS-vsn: usr.sbin/sendmail/src/collect.c 6.19
SCCS-vsn: usr.sbin/sendmail/src/queue.c 6.60

usr/src/usr.sbin/sendmail/src/collect.c
usr/src/usr.sbin/sendmail/src/queue.c

index 31484dc..f80daee 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)collect.c  6.18 (Berkeley) %G%";
+static char sccsid[] = "@(#)collect.c  6.19 (Berkeley) %G%";
 #endif /* not lint */
 
 # include <errno.h>
 #endif /* not lint */
 
 # include <errno.h>
@@ -239,6 +239,7 @@ maketemp(from)
 readerr:
        if (fflush(tf) != 0)
                tferror(tf, e);
 readerr:
        if (fflush(tf) != 0)
                tferror(tf, e);
+       (void) fsync(fileno(tf));
        (void) fclose(tf);
 
        /* An EOF when running SMTP is an error */
        (void) fclose(tf);
 
        /* An EOF when running SMTP is an error */
index c3a1efb..0e54f04 100644 (file)
@@ -10,9 +10,9 @@
 
 #ifndef lint
 #ifdef QUEUE
 
 #ifndef lint
 #ifdef QUEUE
-static char sccsid[] = "@(#)queue.c    6.59 (Berkeley) %G% (with queueing)";
+static char sccsid[] = "@(#)queue.c    6.60 (Berkeley) %G% (with queueing)";
 #else
 #else
-static char sccsid[] = "@(#)queue.c    6.59 (Berkeley) %G% (without queueing)";
+static char sccsid[] = "@(#)queue.c    6.60 (Berkeley) %G% (without queueing)";
 #endif
 #endif /* not lint */
 
 #endif
 #endif /* not lint */
 
@@ -277,6 +277,7 @@ notemp:
        */
 
        fflush(tfp);
        */
 
        fflush(tfp);
+       fsync(fileno(tfp));
        if (ferror(tfp))
        {
                if (newid)
        if (ferror(tfp))
        {
                if (newid)
@@ -303,7 +304,6 @@ notemp:
        if (LogLevel > 79)
                syslog(LOG_DEBUG, "%s: queueup, qf=%s, df=%s\n", e->e_id, qf, e->e_df);
 # endif /* LOG */
        if (LogLevel > 79)
                syslog(LOG_DEBUG, "%s: queueup, qf=%s, df=%s\n", e->e_id, qf, e->e_df);
 # endif /* LOG */
-       fflush(tfp);
        return;
 }
 
        return;
 }