-/* $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.
#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 <sys/param.h>
register struct myutmp *mp;
int f, n, i;
time_t time();
+ int nhosts = 0;
while ((ch = getopt(argc, argv, "a")) != -1)
switch((char)ch) {
(void) close(f);
continue;
}
+ nhosts++;
if (down(w,now)) {
(void) close(f);
continue;
}
(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;