Fix the -t option so that its output matches what the man

page says it prints.  Also silence a few "cc -Wall" warnings.
This commit is contained in:
Mike Pritchard 1996-01-22 09:02:08 +00:00
parent 9bb31b4eef
commit 553072f33a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=13558
3 changed files with 10 additions and 8 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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)