summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sendmail/mailstats/mailstats.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1996-10-24 05:07:25 +0000
committerpeter <peter@FreeBSD.org>1996-10-24 05:07:25 +0000
commitc927066f5476bdb43c28f0e4b780360fcd08fed3 (patch)
tree1a2566bdc48c089b7507030635d9b632523b720f /usr.sbin/sendmail/mailstats/mailstats.c
parent117b06cef4a1d5adbcfb7492dbc5f4a29db0a6a7 (diff)
downloadFreeBSD-src-c927066f5476bdb43c28f0e4b780360fcd08fed3.zip
FreeBSD-src-c927066f5476bdb43c28f0e4b780360fcd08fed3.tar.gz
Fold sendmail-8.8.2 changes into files that have been touched.
(^!&@$#&^! delete !!@^@^ trailing !@^&#$!& whitespace!!!)
Diffstat (limited to 'usr.sbin/sendmail/mailstats/mailstats.c')
-rw-r--r--usr.sbin/sendmail/mailstats/mailstats.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/usr.sbin/sendmail/mailstats/mailstats.c b/usr.sbin/sendmail/mailstats/mailstats.c
index a3015b8..cf11218 100644
--- a/usr.sbin/sendmail/mailstats/mailstats.c
+++ b/usr.sbin/sendmail/mailstats/mailstats.c
@@ -40,9 +40,10 @@ static char copyright[] =
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)mailstats.c 8.4 (Berkeley) 8/14/94";
+static char sccsid[] = "@(#)mailstats.c 8.8 (Berkeley) 9/25/96";
#endif /* not lint */
+#define NOT_SENDMAIL
#include <sendmail.h>
#include <mailstats.h>
#include <pathnames.h>
@@ -91,7 +92,8 @@ main(argc, argv)
case '?':
default:
usage:
- fputs("usage: mailstats [-o] [-C cffile] [-f stfile]\n", stderr);
+ fputs("usage: mailstats [-o] [-C cffile] [-f stfile]\n",
+ stderr);
exit(EX_USAGE);
}
}
@@ -189,13 +191,24 @@ main(argc, argv)
exit (EX_OSFILE);
}
- if ((fd = open(sfile, O_RDONLY)) < 0) {
+ if ((fd = open(sfile, O_RDONLY)) < 0 ||
+ (i = read(fd, &stat, sizeof stat)) < 0)
+ {
fputs("mailstats: ", stderr);
perror(sfile);
exit(EX_NOINPUT);
}
- if (read(fd, &stat, sizeof(stat)) != sizeof(stat) ||
- stat.stat_size != sizeof(stat))
+ if (i == 0)
+ {
+ sleep(1);
+ i = read(fd, &stat, sizeof stat);
+ if (i == 0)
+ {
+ bzero((ARBPTR_T) &stat, sizeof stat);
+ (void) time(&stat.stat_itime);
+ }
+ }
+ else if (i != sizeof stat || stat.stat_size != sizeof(stat))
{
fputs("mailstats: file size changed.\n", stderr);
exit(EX_OSERR);
OpenPOWER on IntegriCloud