summaryrefslogtreecommitdiffstats
path: root/usr.bin/rwho
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>2002-07-01 16:40:33 +0000
committermarkm <markm@FreeBSD.org>2002-07-01 16:40:33 +0000
commitebb4feef4b3c35a922799cd6c35dfb52b1d963b4 (patch)
tree408248ba923c61d61b16b595618bf5ab65680bb6 /usr.bin/rwho
parentff24be4b5ac728817a4a8074df83ae653a1fa1f4 (diff)
downloadFreeBSD-src-ebb4feef4b3c35a922799cd6c35dfb52b1d963b4.zip
FreeBSD-src-ebb4feef4b3c35a922799cd6c35dfb52b1d963b4.tar.gz
Modernise; ISOify, use __FBSDID(), use headers instead of hand-declaring.
Fix easy warnings.
Diffstat (limited to 'usr.bin/rwho')
-rw-r--r--usr.bin/rwho/rwho.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/usr.bin/rwho/rwho.c b/usr.bin/rwho/rwho.c
index fe3a17d..be82ad3 100644
--- a/usr.bin/rwho/rwho.c
+++ b/usr.bin/rwho/rwho.c
@@ -41,13 +41,16 @@ static const char copyright[] =
#if 0
static char sccsid[] = "@(#)rwho.c 8.1 (Berkeley) 6/6/93";
#endif
-static const char rcsid[] =
- "$FreeBSD$";
#endif /* not lint */
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
#include <sys/param.h>
#include <sys/file.h>
+
#include <protocols/rwhod.h>
+
#include <dirent.h>
#include <err.h>
#include <langinfo.h>
@@ -56,13 +59,13 @@ static const char rcsid[] =
#include <stdlib.h>
#include <string.h>
#include <time.h>
+#include <timeconv.h>
#include <unistd.h>
#include <utmp.h>
DIR *dirp;
struct whod wd;
-int utmpcmp();
#define NUSERS 1000
struct myutmp {
char myhost[sizeof(wd.wd_hostname)];
@@ -71,7 +74,7 @@ struct myutmp {
} myutmp[NUSERS];
int nusers;
-#define WHDRSIZE (sizeof (wd) - sizeof (wd.wd_we))
+#define WHDRSIZE (ssize_t)(sizeof (wd) - sizeof (wd.wd_we))
/*
* this macro should be shared with ruptime.
*/
@@ -84,13 +87,12 @@ static void usage(void);
int utmpcmp(const void *, const void *);
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
int ch;
struct dirent *dp;
- int cc, width;
+ int width;
+ ssize_t cc;
register struct whod *w = &wd;
register struct whoent *we;
register struct myutmp *mp;
@@ -196,17 +198,16 @@ main(argc, argv)
static void
-usage()
+usage(void)
{
fprintf(stderr, "usage: rwho [-a]\n");
exit(1);
}
-#define MYUTMP(a) ((struct myutmp *)(a))
+#define MYUTMP(a) ((const struct myutmp *)(a))
int
-utmpcmp(u1, u2)
- const void *u1, *u2;
+utmpcmp(const void *u1, const void *u2)
{
int rc;
OpenPOWER on IntegriCloud