summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-06-20 10:00:02 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-06-20 10:00:02 +0000
commita44decc3ab1973b21b389355a9c4cd570002030e (patch)
tree5c5efe7bed1976b043abe0c4a2304a062876361a
parent0bbb1c2a8350a3c65cfd5cf622af4a71c58ecbc5 (diff)
Wall
-rw-r--r--usr.bin/ruptime/ruptime.c15
-rw-r--r--usr.bin/rwho/rwho.c5
2 files changed, 15 insertions, 5 deletions
diff --git a/usr.bin/ruptime/ruptime.c b/usr.bin/ruptime/ruptime.c
index 9df8234404e..b2000bc8fa3 100644
--- a/usr.bin/ruptime/ruptime.c
+++ b/usr.bin/ruptime/ruptime.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ruptime.c,v 1.3 1997/01/15 23:43:10 millert Exp $ */
+/* $OpenBSD: ruptime.c,v 1.4 1997/06/20 09:59:27 deraadt Exp $ */
/*
* Copyright (c) 1983 The Regents of the University of California.
@@ -41,7 +41,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)ruptime.c 5.8 (Berkeley) 7/21/90";*/
-static char rcsid[] = "$OpenBSD: ruptime.c,v 1.3 1997/01/15 23:43:10 millert Exp $";
+static char rcsid[] = "$OpenBSD: ruptime.c,v 1.4 1997/06/20 09:59:27 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -49,6 +49,7 @@ static char rcsid[] = "$OpenBSD: ruptime.c,v 1.3 1997/01/15 23:43:10 millert Exp
#include <dirent.h>
#include <protocols/rwhod.h>
#include <stdio.h>
+#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
@@ -67,6 +68,9 @@ time_t now;
int rflg = 1;
int hscmp(), ucmp(), lcmp(), tcmp();
+void morehosts __P((void));
+
+int
main(argc, argv)
int argc;
char **argv;
@@ -115,7 +119,7 @@ main(argc, argv)
morehosts();
hsp = hs;
maxloadav = -1;
- while (dp = readdir(dirp)) {
+ while ((dp = readdir(dirp))) {
if (dp->d_ino == 0 || strncmp(dp->d_name, "whod.", 5))
continue;
if ((f = open(dp->d_name, O_RDONLY, 0)) < 0) {
@@ -202,6 +206,7 @@ interval(tval, updown)
}
/* alphabetical comparison */
+int
hscmp(a1, a2)
void *a1, *a2;
{
@@ -211,6 +216,7 @@ hscmp(a1, a2)
}
/* load average comparison */
+int
lcmp(a1, a2)
void *a1, *a2;
{
@@ -229,6 +235,7 @@ lcmp(a1, a2)
}
/* number of users comparison */
+int
ucmp(a1, a2)
void *a1, *a2;
{
@@ -246,6 +253,7 @@ ucmp(a1, a2)
}
/* uptime comparison */
+int
tcmp(a1, a2)
void *a1, *a2;
{
@@ -260,6 +268,7 @@ tcmp(a1, a2)
));
}
+void
morehosts()
{
hs = realloc((char *)hs, (hspace *= 2) * sizeof(*hs));
diff --git a/usr.bin/rwho/rwho.c b/usr.bin/rwho/rwho.c
index 0135865dfb5..51bca54e8e0 100644
--- a/usr.bin/rwho/rwho.c
+++ b/usr.bin/rwho/rwho.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rwho.c,v 1.8 1997/04/13 02:30:34 deraadt Exp $ */
+/* $OpenBSD: rwho.c,v 1.9 1997/06/20 10:00:01 deraadt Exp $ */
/*
* Copyright (c) 1983 The Regents of the University of California.
@@ -41,7 +41,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)rwho.c 5.5 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$OpenBSD: rwho.c,v 1.8 1997/04/13 02:30:34 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: rwho.c,v 1.9 1997/06/20 10:00:01 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -53,6 +53,7 @@ static char rcsid[] = "$OpenBSD: rwho.c,v 1.8 1997/04/13 02:30:34 deraadt Exp $"
#include <unistd.h>
#include <stdlib.h>
#include <vis.h>
+#include <err.h>
DIR *dirp;