From 5b93ecb3508aefbaa09f08ad8c30f798e5909935 Mon Sep 17 00:00:00 2001 From: Michael Kupfer Date: Tue, 7 May 1985 20:32:01 -0800 Subject: [PATCH] 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 --- usr/src/usr.bin/rwho/rwho.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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, -- 2.20.1