summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1998-08-04 13:46:46 +0000
committerpeter <peter@FreeBSD.org>1998-08-04 13:46:46 +0000
commit04a0df2514506f6c0691dbf848c063069f665fd2 (patch)
tree2f4512dcb1e3039c56f8e9f6c4975fed7270095a /contrib
parent50094ad9a7c3572b227667744e94f0c06e04295f (diff)
downloadFreeBSD-src-04a0df2514506f6c0691dbf848c063069f665fd2.zip
FreeBSD-src-04a0df2514506f6c0691dbf848c063069f665fd2.tar.gz
Invert the sense of the -s flag (local addition). Instead of compiling
in the behavior via the previously default #define DONT_FSYNC, use the -s flag to turn the fsync() behavior on. This can be configured in sendmail.cf without recompiling mail.local.
Diffstat (limited to 'contrib')
-rw-r--r--contrib/sendmail/mail.local/mail.local.85
-rw-r--r--contrib/sendmail/mail.local/mail.local.c22
2 files changed, 14 insertions, 13 deletions
diff --git a/contrib/sendmail/mail.local/mail.local.8 b/contrib/sendmail/mail.local/mail.local.8
index 7aa7cdb..3bc0a77 100644
--- a/contrib/sendmail/mail.local/mail.local.8
+++ b/contrib/sendmail/mail.local/mail.local.8
@@ -40,11 +40,12 @@ Turn off the attempts to notify the
.Dq biff
service.
.It Fl s
-Turn off the
+Turn on the
.Xr fsync 2
call that forces the mailbox to be committed to disk before returning a
.Dq success
-status.
+status. (This can configured in the flags passed through from
+.Xr sendmail 8 ).
.El
.Pp
Individual mail messages in the mailbox are delimited by an empty
diff --git a/contrib/sendmail/mail.local/mail.local.c b/contrib/sendmail/mail.local/mail.local.c
index 2a3b072..09a66c4 100644
--- a/contrib/sendmail/mail.local/mail.local.c
+++ b/contrib/sendmail/mail.local/mail.local.c
@@ -239,7 +239,7 @@ main(argc, argv)
char *argv[];
{
struct passwd *pw;
- int ch, fd, nobiff, nofsync;
+ int ch, fd, nobiff, dofsync;
uid_t uid;
char *from;
extern char *optarg;
@@ -260,7 +260,7 @@ main(argc, argv)
from = NULL;
nobiff = 0;
- nofsync = 0;
+ dofsync = 0;
while ((ch = getopt(argc, argv, "bdf:r:ls")) != -1)
switch(ch) {
case 'b':
@@ -280,7 +280,7 @@ main(argc, argv)
lmtpmode++;
break;
case 's':
- nofsync++;
+ dofsync++;
break;
case '?':
default:
@@ -290,7 +290,7 @@ main(argc, argv)
argv += optind;
if (lmtpmode)
- dolmtp(nobiff, nofsync);
+ dolmtp(nobiff, dofsync);
if (!*argv)
usage();
@@ -315,7 +315,7 @@ main(argc, argv)
* at the expense of repeated failures and multiple deliveries.
*/
for (fd = store(from, 0); *argv; ++argv)
- deliver(fd, *argv, nobiff, nofsync);
+ deliver(fd, *argv, nobiff, dofsync);
exit(eval);
}
@@ -431,8 +431,8 @@ process_recipient(addr)
#define RCPT_GROW 30
void
-dolmtp(nobiff, nofsync)
- int nobiff, nofsync;
+dolmtp(nobiff, dofsync)
+ int nobiff, dofsync;
{
char *return_path = NULL;
char **rcpt_addr = NULL;
@@ -477,7 +477,7 @@ dolmtp(nobiff, nofsync)
if (p != NULL)
*p++ = '\0';
deliver(msgfd, rcpt_addr[i], nobiff,
- nofsync);
+ dofsync);
}
close(msgfd);
goto rset;
@@ -680,10 +680,10 @@ store(from, lmtprcpts)
}
void
-deliver(fd, name, nobiff, nofsync)
+deliver(fd, name, nobiff, dofsync)
int fd;
char *name;
- int nobiff, nofsync;
+ int nobiff, dofsync;
{
struct stat fsb, sb;
struct passwd *pw;
@@ -851,7 +851,7 @@ tryagain:
}
/* Flush to disk, don't wait for update. */
- if (!nofsync && fsync(mbfd)) {
+ if (dofsync && fsync(mbfd)) {
mailerr("450 4.2.0", "%s: %s", path, strerror(errno));
err3:
if (setreuid(0, 0) < 0) {
OpenPOWER on IntegriCloud