=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/rwho/Attic/rwho.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- src/usr.bin/rwho/Attic/rwho.c 1997/01/15 23:43:10 1.5 +++ src/usr.bin/rwho/Attic/rwho.c 1997/03/26 18:02:37 1.6 @@ -1,4 +1,4 @@ -/* $OpenBSD: rwho.c,v 1.5 1997/01/15 23:43:10 millert Exp $ */ +/* $OpenBSD: rwho.c,v 1.6 1997/03/26 18:02:37 deraadt Exp $ */ /* * Copyright (c) 1983 The Regents of the University of California. @@ -41,7 +41,7 @@ #ifndef lint /*static char sccsid[] = "from: @(#)rwho.c 5.5 (Berkeley) 6/1/90";*/ -static char rcsid[] = "$OpenBSD: rwho.c,v 1.5 1997/01/15 23:43:10 millert Exp $"; +static char rcsid[] = "$OpenBSD: rwho.c,v 1.6 1997/03/26 18:02:37 deraadt Exp $"; #endif /* not lint */ #include @@ -91,6 +91,7 @@ register struct myutmp *mp; int f, n, i; time_t time(); + int nhosts = 0; while ((ch = getopt(argc, argv, "a")) != -1) switch((char)ch) { @@ -119,6 +120,7 @@ (void) close(f); continue; } + nhosts++; if (down(w,now)) { (void) close(f); continue; @@ -142,6 +144,8 @@ } (void) close(f); } + if (nhosts == 0) + errx(0, "no hosts in %s.", _PATH_RWHODIR); qsort((char *)myutmp, nusers, sizeof (struct myutmp), (int (*)())utmpcmp); mp = myutmp;