diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2013-04-02 03:06:08 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2013-04-02 03:06:08 +0000 |
commit | b73dea11665b5876fc500ceea0fb07052b2e4f1c (patch) | |
tree | 710506915fed01cdd631a816c8f785b6a44fe312 /usr.sbin/rwhod | |
parent | 8cc477c7bddf7f6cd04ada7f1a56a2787b9ea2d8 (diff) |
handle large time_t at least until 2038. then chaos breaks out.
ok guenther
note to tedu: 2038 -> rwhod
Diffstat (limited to 'usr.sbin/rwhod')
-rw-r--r-- | usr.sbin/rwhod/rwhod.c | 4 |
1 files changed, 3 insertions, 1 deletions
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); |