summaryrefslogtreecommitdiff
path: root/gnu/usr.sbin/sendmail/mailstats
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2001-01-15 21:09:13 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2001-01-15 21:09:13 +0000
commit5062bcecfa81a7e0dd07894d6e93655a97239964 (patch)
treefd0e0dd2a71271dbe81c195cd9fbdd57fb7c20fb /gnu/usr.sbin/sendmail/mailstats
parent91deaea81040227b9ba537ff047f1f863f75fc31 (diff)
sendmail 8.11.2 with BSD Makefiles
Diffstat (limited to 'gnu/usr.sbin/sendmail/mailstats')
-rw-r--r--gnu/usr.sbin/sendmail/mailstats/mailstats.810
-rw-r--r--gnu/usr.sbin/sendmail/mailstats/mailstats.c17
2 files changed, 14 insertions, 13 deletions
diff --git a/gnu/usr.sbin/sendmail/mailstats/mailstats.8 b/gnu/usr.sbin/sendmail/mailstats/mailstats.8
index 621a6f0d60d..604266347ff 100644
--- a/gnu/usr.sbin/sendmail/mailstats/mailstats.8
+++ b/gnu/usr.sbin/sendmail/mailstats/mailstats.8
@@ -6,9 +6,9 @@
.\" the sendmail distribution.
.\"
.\"
-.\" $Sendmail: mailstats.8,v 8.16 2000/02/01 05:49:53 gshapiro Exp $
+.\" $Sendmail: mailstats.8,v 8.17.4.3 2000/12/29 18:12:20 gshapiro Exp $
.\"
-.Dd April 25, 1996
+.Dd December 29, 2000
.Dt MAILSTATS 1
.Os
.Sh NAME
@@ -65,14 +65,12 @@ The options are as follows:
.It Fl C
Read the specified file instead of the default
.Nm sendmail
-.Dq cf
-file.
+configuration file.
.It Fl f
Read the specified statistics file instead of the statistics file
specified in the
.Nm sendmail
-.Dq cf
-file.
+configuration file.
.It Fl p
Output information in program-readable mode and clear statistics.
.It Fl o
diff --git a/gnu/usr.sbin/sendmail/mailstats/mailstats.c b/gnu/usr.sbin/sendmail/mailstats/mailstats.c
index 74746da99e5..33cc299aed0 100644
--- a/gnu/usr.sbin/sendmail/mailstats/mailstats.c
+++ b/gnu/usr.sbin/sendmail/mailstats/mailstats.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 1999 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -14,14 +14,14 @@
#ifndef lint
static char copyright[] =
-"@(#) Copyright (c) 1998, 1999 Sendmail, Inc. and its suppliers.\n\
+"@(#) Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.\n\
All rights reserved.\n\
Copyright (c) 1988, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* ! lint */
#ifndef lint
-static char id[] = "@(#)$Sendmail: mailstats.c,v 8.53 1999/10/13 05:43:54 gshapiro Exp $";
+static char id[] = "@(#)$Sendmail: mailstats.c,v 8.53.16.11 2000/09/17 17:04:26 gshapiro Exp $";
#endif /* ! lint */
#include <unistd.h>
@@ -39,8 +39,10 @@ static char id[] = "@(#)$Sendmail: mailstats.c,v 8.53 1999/10/13 05:43:54 gshapi
#include <sendmail/mailstats.h>
#include <sendmail/pathnames.h>
+
#define MNAMELEN 20 /* max length of mailer name */
+
int
main(argc, argv)
int argc;
@@ -66,11 +68,12 @@ main(argc, argv)
extern char *optarg;
extern int optind;
+
cfile = _PATH_SENDMAILCF;
sfile = NULL;
mnames = TRUE;
progmode = FALSE;
- while ((ch = getopt(argc, argv, "C:f:op")) != EOF)
+ while ((ch = getopt(argc, argv, "C:f:op")) != -1)
{
switch (ch)
{
@@ -93,7 +96,7 @@ main(argc, argv)
case '?':
default:
usage:
- (void) fputs("usage: mailstats [-C cffile] [-f stfile] -o -p\n",
+ (void) fputs("usage: mailstats [-C cffile] [-f stfile] [-o] [-p]\n",
stderr);
exit(EX_USAGE);
}
@@ -202,8 +205,8 @@ main(argc, argv)
exit (EX_OSFILE);
}
- if ((fd = open(sfile, O_RDONLY)) < 0 ||
- (i = read(fd, &stats, sizeof stats)) < 0)
+ fd = open(sfile, O_RDONLY);
+ if ((fd < 0) || (i = read(fd, &stats, sizeof stats)) < 0)
{
save_errno = errno;
(void) fputs("mailstats: ", stderr);