From: Michael Kupfer Date: Wed, 8 May 1985 04:32:01 +0000 (-0800) Subject: Wait 11 minutes before deciding a machine is down (same as ruptime). X-Git-Tag: BSD-4_3-Snapshot-Development~7172 X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/5b93ecb3508aefbaa09f08ad8c30f798e5909935?hp=36b7766180d8f53596c10a4c8fc848659422dc0b Wait 11 minutes before deciding a machine is down (same as ruptime). Define a macro for deciding if a machine is down. SCCS-vsn: usr.bin/rwho/rwho.c 4.9 --- diff --git a/usr/src/usr.bin/rwho/rwho.c b/usr/src/usr.bin/rwho/rwho.c index 9830ae1794..805c21e2ab 100644 --- a/usr/src/usr.bin/rwho/rwho.c +++ b/usr/src/usr.bin/rwho/rwho.c @@ -21,6 +21,10 @@ int nusers; #define WHDRSIZE (sizeof (wd) - sizeof (wd.wd_we)) #define RWHODIR "/usr/spool/rwho" +/* + * this macro should be shared with ruptime. + */ +#define down(w,now) ((now) - (w)->wd_recvtime > 11 * 60) char *ctime(), *strcpy(); int now; @@ -68,7 +72,7 @@ again: (void) close(f); continue; } - if (now - w->wd_recvtime > 5 * 60) { + if (down(w,now)) { (void) close(f); continue; } @@ -101,7 +105,7 @@ again: mp = myutmp; for (i = 0; i < nusers; i++) { char buf[22]; - sprintf(buf, "%s:%s", mp->myhost, mp->myutmp.out_line); + (void)sprintf(buf, "%s:%s", mp->myhost, mp->myutmp.out_line); printf("%-8.8s %-*s %.12s", mp->myutmp.out_name, width,