From b73dea11665b5876fc500ceea0fb07052b2e4f1c Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Tue, 2 Apr 2013 03:06:08 +0000 Subject: handle large time_t at least until 2038. then chaos breaks out. ok guenther note to tedu: 2038 -> rwhod --- usr.sbin/rwhod/rwhod.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'usr.sbin/rwhod') diff --git a/usr.sbin/rwhod/rwhod.c b/usr.sbin/rwhod/rwhod.c index 61b6c8288a5..a85e6cbca07 100644 --- a/usr.sbin/rwhod/rwhod.c +++ b/usr.sbin/rwhod/rwhod.c @@ -219,6 +219,7 @@ handleread(int s) char path[64]; struct whod wd; int cc, whod; + time_t t; socklen_t len = sizeof(from); cc = recvfrom(s, (char *)&wd, sizeof(struct whod), 0, @@ -280,7 +281,8 @@ handleread(int s) } } #endif - (void) time((time_t *)&wd.wd_recvtime); + (void) time(&t); + wd.wd_recvtime = t; /* XXX protocol breaks in 2038 */ (void) write(whod, (char *)&wd, cc); if (fstat(whod, &st) < 0 || st.st_size > cc) ftruncate(whod, (off_t)cc); -- cgit v1.2.3