diff --git a/usr.bin/w/pr_time.c b/usr.bin/w/pr_time.c index c48f6a7cf738..5dcfcbcf7555 100644 --- a/usr.bin/w/pr_time.c +++ b/usr.bin/w/pr_time.c @@ -32,7 +32,11 @@ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)pr_time.c 8.2 (Berkeley) 4/4/94"; +#endif +static const char rcsid[] = + "$Id$"; #endif /* not lint */ #include @@ -100,14 +104,14 @@ pr_idle(idle) /* If idle more than an hour, print as HH:MM. */ else if (idle >= 3600) (void)printf(" %2d:%02d ", - idle / 3600, (idle % 3600) / 60); + (int)idle / 3600, (int)(idle % 3600) / 60); else if (idle / 60 == 0) (void)printf(" - "); /* Else print the minutes idle. */ else - (void)printf(" %2d ", idle / 60); + (void)printf(" %2d ", (int)idle / 60); return(0); /* not idle longer than 9 days */ } diff --git a/usr.bin/w/uptime.1 b/usr.bin/w/uptime.1 index 8589bbc02f33..471f2f9385b3 100644 --- a/usr.bin/w/uptime.1 +++ b/usr.bin/w/uptime.1 @@ -38,10 +38,10 @@ .Nm uptime .Nd show how long system has been running .Sh SYNOPSIS -.Nm uptime +.Nm .Sh DESCRIPTION The -.Nm uptime +.Nm utility displays the current time, the length of time the system has been up, the number of users, and the load average of the system over the last diff --git a/usr.bin/w/w.1 b/usr.bin/w/w.1 index b0a03f6f7ae5..64c5b60bed3e 100644 --- a/usr.bin/w/w.1 +++ b/usr.bin/w/w.1 @@ -30,14 +30,14 @@ .\" SUCH DAMAGE. .\" .\" @(#)w.1 8.1 (Berkeley) 6/6/93 -.\" $Id$ +.\" $Id: w.1,v 1.6 1997/02/22 19:57:41 peter Exp $ .\" .Dd June 6, 1993 .Dt W 1 .Os BSD 4 .Sh NAME .Nm w -.Nd "who present users are and what they are doing" +.Nd who present users are and what they are doing .Sh SYNOPSIS .Nm w .Op Fl hin @@ -46,7 +46,7 @@ .Op Ar user .Sh DESCRIPTION The -.Nm w +.Nm utility prints a summary of the current activity on the system, including what each user is doing. The first line displays the current time of day, how long the system has @@ -76,7 +76,7 @@ default .Dq /kernel . .It Fl n Show network addresses as numbers (normally -.Nm w +.Nm interprets addresses and attempts to display them symbolically). .El .Pp @@ -104,7 +104,7 @@ This fails, for example, in critical sections of programs like the shell and editor, or when faulty programs running in the background fork and fail to ignore interrupts. (In cases where no process can be found, -.Nm w +.Nm prints .Dq \- . ) .Pp @@ -123,7 +123,7 @@ null or garbaged arguments. In these cases, the name of the command is printed in parentheses. .Pp The -.Nm w +.Nm utility does not know about the new conventions for detection of background jobs. It will sometimes find a background job instead of the right one. diff --git a/usr.bin/w/w.c b/usr.bin/w/w.c index 251cde0b9324..1f16154fcdb0 100644 --- a/usr.bin/w/w.c +++ b/usr.bin/w/w.c @@ -32,13 +32,17 @@ */ #ifndef lint -static char copyright[] = +static const char copyright[] = "@(#) Copyright (c) 1980, 1991, 1993, 1994\n\ The Regents of the University of California. All rights reserved.\n"; #endif /* not lint */ #ifndef lint +#if 0 static char sccsid[] = "@(#)w.c 8.4 (Berkeley) 4/16/94"; +#endif +static const char rcsid[] = + "$Id$"; #endif /* not lint */ /* @@ -204,7 +208,7 @@ main(argc, argv) strncmp(utmp.ut_name, sel_user, UT_NAMESIZE) != 0)) continue; if ((ep = calloc(1, sizeof(struct entry))) == NULL) - err(1, NULL); + errx(1, "calloc"); *nextp = ep; nextp = &(ep->next); memmove(&(ep->utmp), &utmp, sizeof(struct utmp)); @@ -306,7 +310,7 @@ main(argc, argv) } if ((vis_args = malloc(argwidth * 4 + 1)) == NULL) - err(1, NULL); + errx(1, "malloc"); for (ep = ehead; ep != NULL; ep = ep->next) { p = *ep->utmp.ut_host ? ep->utmp.ut_host : "-"; if ((x = strchr(p, ':')) != NULL) @@ -451,8 +455,9 @@ usage(wcmd) { if (wcmd) (void)fprintf(stderr, - "usage: w: [-hin] [-M core] [-N system] [user]\n"); + "usage: w [-hin] [-M core] [-N system] [user]\n"); else - (void)fprintf(stderr, "uptime\n"); + (void)fprintf(stderr, + "usage: uptime\n"); exit (1); }