=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ruptime/Attic/ruptime.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- src/usr.bin/ruptime/Attic/ruptime.c 1997/01/15 23:43:10 1.3 +++ src/usr.bin/ruptime/Attic/ruptime.c 1997/06/20 09:59:27 1.4 @@ -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 @@ #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 @@ -49,6 +49,7 @@ #include #include #include +#include #include #include #include @@ -67,6 +68,9 @@ int rflg = 1; int hscmp(), ucmp(), lcmp(), tcmp(); +void morehosts __P((void)); + +int main(argc, argv) int argc; char **argv; @@ -115,7 +119,7 @@ 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 @@ } /* alphabetical comparison */ +int hscmp(a1, a2) void *a1, *a2; { @@ -211,6 +216,7 @@ } /* load average comparison */ +int lcmp(a1, a2) void *a1, *a2; { @@ -229,6 +235,7 @@ } /* number of users comparison */ +int ucmp(a1, a2) void *a1, *a2; { @@ -246,6 +253,7 @@ } /* uptime comparison */ +int tcmp(a1, a2) void *a1, *a2; { @@ -260,6 +268,7 @@ )); } +void morehosts() { hs = realloc((char *)hs, (hspace *= 2) * sizeof(*hs));