summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sa
diff options
context:
space:
mode:
authormpp <mpp@FreeBSD.org>1996-01-22 09:02:08 +0000
committermpp <mpp@FreeBSD.org>1996-01-22 09:02:08 +0000
commit45b01cc2e88de973b5bc40b2f16cf81ea5c27449 (patch)
treea716e7feae298c903386f7e15527f60d7ef544ba /usr.sbin/sa
parenta447e85f39ce79de3c25035acf926a5082e32213 (diff)
downloadFreeBSD-src-45b01cc2e88de973b5bc40b2f16cf81ea5c27449.zip
FreeBSD-src-45b01cc2e88de973b5bc40b2f16cf81ea5c27449.tar.gz
Fix the -t option so that its output matches what the man
page says it prints. Also silence a few "cc -Wall" warnings.
Diffstat (limited to 'usr.sbin/sa')
-rw-r--r--usr.sbin/sa/main.c5
-rw-r--r--usr.sbin/sa/pdb.c5
-rw-r--r--usr.sbin/sa/usrdb.c8
3 files changed, 10 insertions, 8 deletions
diff --git a/usr.sbin/sa/main.c b/usr.sbin/sa/main.c
index 2f1e95a..ebe491e 100644
--- a/usr.sbin/sa/main.c
+++ b/usr.sbin/sa/main.c
@@ -33,7 +33,7 @@ static char copright[] =
"@(#) Copyright (c) 1994 Christopher G. Demetriou\n\
All rights reserved.\n";
-static char rcsid[] = "$Id: main.c,v 1.1.1.1 1994/09/26 21:22:56 davidg Exp $";
+static char rcsid[] = "$Id: main.c,v 1.2 1995/05/30 03:51:39 rgrimes Exp $";
#endif
/*
@@ -48,6 +48,7 @@ static char rcsid[] = "$Id: main.c,v 1.1.1.1 1994/09/26 21:22:56 davidg Exp $";
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <unistd.h>
#include "extern.h"
#include "pathnames.h"
@@ -349,7 +350,7 @@ acct_load(pn, wr)
if (sflag || (mflag && !qflag))
usracct_add(&ci);
} else if (!qflag)
- printf("%6u %12.2lf cpu %12quk mem %12qu io %s\n",
+ printf("%6lu %12.2f cpu %12quk mem %12qu io %s\n",
ci.ci_uid,
(ci.ci_utime + ci.ci_stime) / (double) AHZ,
ci.ci_mem, ci.ci_io, ci.ci_comm);
diff --git a/usr.sbin/sa/pdb.c b/usr.sbin/sa/pdb.c
index 1ccbe90..8a41591 100644
--- a/usr.sbin/sa/pdb.c
+++ b/usr.sbin/sa/pdb.c
@@ -29,7 +29,7 @@
*/
#ifndef LINT
-static char rcsid[] = "$Id: pdb.c,v 1.1.1.1 1994/09/26 21:22:56 davidg Exp $";
+static char rcsid[] = "$Id: pdb.c,v 1.2 1995/05/30 03:51:41 rgrimes Exp $";
#endif
#include <sys/types.h>
@@ -38,6 +38,7 @@ static char rcsid[] = "$Id: pdb.c,v 1.1.1.1 1994/09/26 21:22:56 davidg Exp $";
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
+#include <string.h>
#include "extern.h"
#include "pathnames.h"
@@ -402,7 +403,7 @@ print_ci(cip, totalcip)
if (!uflow)
printf("%8.2fre/cp ", cip->ci_etime / (double) (cip->ci_utime + cip->ci_stime));
else
- printf("%8 ", "*ignore*");
+ printf("*ignore* ");
if (Dflag)
printf("%10qutio ", cip->ci_io);
diff --git a/usr.sbin/sa/usrdb.c b/usr.sbin/sa/usrdb.c
index 4d383b7..1d19c45 100644
--- a/usr.sbin/sa/usrdb.c
+++ b/usr.sbin/sa/usrdb.c
@@ -29,7 +29,7 @@
*/
#ifndef LINT
-static char rcsid[] = "$Id: usrdb.c,v 1.1.1.1 1994/09/26 21:22:57 davidg Exp $";
+static char rcsid[] = "$Id: usrdb.c,v 1.2 1995/05/30 03:51:42 rgrimes Exp $";
#endif
#include <sys/types.h>
@@ -37,6 +37,8 @@ static char rcsid[] = "$Id: usrdb.c,v 1.1.1.1 1994/09/26 21:22:57 davidg Exp $";
#include <err.h>
#include <errno.h>
#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
#include "extern.h"
#include "pathnames.h"
@@ -171,7 +173,6 @@ usracct_update()
DB *saved_usracct_db;
DBT key, data;
BTREEINFO bti;
- u_long uid;
int error, serr, nerr;
bzero(&bti, sizeof bti);
@@ -211,7 +212,6 @@ usracct_update()
warn("syncing process accounting summary");
error = -1;
}
-out:
if (DB_CLOSE(saved_usracct_db) < 0) {
warn("closing process accounting summary");
error = -1;
@@ -242,7 +242,7 @@ usracct_print()
if (t < 0.0001) /* kill divide by zero */
t = 0.0001;
- printf("%12.2lf%s ", t / 60.0, "cpu");
+ printf("%12.2f%s ", t / 60.0, "cpu");
/* ui->ui_calls is always != 0 */
if (dflag)
OpenPOWER on IntegriCloud