=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/rwho/Attic/rwho.c,v retrieving revision 1.5 retrieving revision 1.6 diff -c -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 **** ! /* $OpenBSD: rwho.c,v 1.5 1997/01/15 23:43:10 millert Exp $ */ /* * Copyright (c) 1983 The Regents of the University of California. --- 1,4 ---- ! /* $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,47 **** #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 $"; #endif /* not lint */ #include --- 41,47 ---- #ifndef lint /*static char sccsid[] = "from: @(#)rwho.c 5.5 (Berkeley) 6/1/90";*/ ! static char rcsid[] = "$OpenBSD: rwho.c,v 1.6 1997/03/26 18:02:37 deraadt Exp $"; #endif /* not lint */ #include *************** *** 91,96 **** --- 91,97 ---- 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,124 **** --- 120,126 ---- (void) close(f); continue; } + nhosts++; if (down(w,now)) { (void) close(f); continue; *************** *** 142,147 **** --- 144,151 ---- } (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;