From 5d53f683d343284d8af3d523e9422c37bb829d67 Mon Sep 17 00:00:00 2001 From: "Marc G. Fournier" Date: Wed, 23 Oct 1996 04:23:36 +0000 Subject: [PATCH] Description: Machine come and go... Little patch removes lists down for over 4 days from the list. (If you haven't noticed they are down in that period, you should turn them off!) Closes: PR#bin/1361 Submitted by: xaa@stack.urc.tue.nl --- usr.bin/ruptime/ruptime.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/usr.bin/ruptime/ruptime.c b/usr.bin/ruptime/ruptime.c index ba02fdbd05d3..1fa0641098d8 100644 --- a/usr.bin/ruptime/ruptime.c +++ b/usr.bin/ruptime/ruptime.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. */ -/* $Id: ruptime.c,v 1.5 1995/08/07 19:17:40 wollman Exp $ */ +/* $Id: ruptime.c,v 1.6 1995/09/08 20:33:21 jkh Exp $ */ #ifndef lint static char copyright[] = @@ -62,7 +62,7 @@ struct hs { int hs_nusers; } *hs; struct whod awhod; - +#define LEFTEARTH(h) (now - (h)->hs_wd->wd_recvtime > 4*24*60*60) #define ISDOWN(h) (now - (h)->hs_wd->wd_recvtime > 11 * 60) #define WHDRSIZE (sizeof (awhod) - sizeof (awhod.wd_we)) @@ -167,6 +167,8 @@ main(argc, argv) qsort(hs, nhosts, sizeof(hs[0]), cmp); for (i = 0; i < nhosts; i++) { hsp = &hs[i]; + if (LEFTEARTH(hsp)) + continue; if (ISDOWN(hsp)) { (void)printf("%-12.12s%s\n", hsp->hs_wd->wd_hostname, interval(now - hsp->hs_wd->wd_recvtime, "down"));