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:
parent
9bb31b4eef
commit
553072f33a
@ -33,7 +33,7 @@ static char copright[] =
|
|||||||
"@(#) Copyright (c) 1994 Christopher G. Demetriou\n\
|
"@(#) Copyright (c) 1994 Christopher G. Demetriou\n\
|
||||||
All rights reserved.\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
|
#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 <signal.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include "extern.h"
|
#include "extern.h"
|
||||||
#include "pathnames.h"
|
#include "pathnames.h"
|
||||||
@ -349,7 +350,7 @@ acct_load(pn, wr)
|
|||||||
if (sflag || (mflag && !qflag))
|
if (sflag || (mflag && !qflag))
|
||||||
usracct_add(&ci);
|
usracct_add(&ci);
|
||||||
} else if (!qflag)
|
} 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_uid,
|
||||||
(ci.ci_utime + ci.ci_stime) / (double) AHZ,
|
(ci.ci_utime + ci.ci_stime) / (double) AHZ,
|
||||||
ci.ci_mem, ci.ci_io, ci.ci_comm);
|
ci.ci_mem, ci.ci_io, ci.ci_comm);
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LINT
|
#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
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
#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 <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
#include "extern.h"
|
#include "extern.h"
|
||||||
#include "pathnames.h"
|
#include "pathnames.h"
|
||||||
|
|
||||||
@ -402,7 +403,7 @@ print_ci(cip, totalcip)
|
|||||||
if (!uflow)
|
if (!uflow)
|
||||||
printf("%8.2fre/cp ", cip->ci_etime / (double) (cip->ci_utime + cip->ci_stime));
|
printf("%8.2fre/cp ", cip->ci_etime / (double) (cip->ci_utime + cip->ci_stime));
|
||||||
else
|
else
|
||||||
printf("%8 ", "*ignore*");
|
printf("*ignore* ");
|
||||||
|
|
||||||
if (Dflag)
|
if (Dflag)
|
||||||
printf("%10qutio ", cip->ci_io);
|
printf("%10qutio ", cip->ci_io);
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LINT
|
#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
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
#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 <err.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
#include "extern.h"
|
#include "extern.h"
|
||||||
#include "pathnames.h"
|
#include "pathnames.h"
|
||||||
|
|
||||||
@ -171,7 +173,6 @@ usracct_update()
|
|||||||
DB *saved_usracct_db;
|
DB *saved_usracct_db;
|
||||||
DBT key, data;
|
DBT key, data;
|
||||||
BTREEINFO bti;
|
BTREEINFO bti;
|
||||||
u_long uid;
|
|
||||||
int error, serr, nerr;
|
int error, serr, nerr;
|
||||||
|
|
||||||
bzero(&bti, sizeof bti);
|
bzero(&bti, sizeof bti);
|
||||||
@ -211,7 +212,6 @@ usracct_update()
|
|||||||
warn("syncing process accounting summary");
|
warn("syncing process accounting summary");
|
||||||
error = -1;
|
error = -1;
|
||||||
}
|
}
|
||||||
out:
|
|
||||||
if (DB_CLOSE(saved_usracct_db) < 0) {
|
if (DB_CLOSE(saved_usracct_db) < 0) {
|
||||||
warn("closing process accounting summary");
|
warn("closing process accounting summary");
|
||||||
error = -1;
|
error = -1;
|
||||||
@ -242,7 +242,7 @@ usracct_print()
|
|||||||
if (t < 0.0001) /* kill divide by zero */
|
if (t < 0.0001) /* kill divide by zero */
|
||||||
t = 0.0001;
|
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 */
|
/* ui->ui_calls is always != 0 */
|
||||||
if (dflag)
|
if (dflag)
|
||||||
|
Loading…
Reference in New Issue
Block a user