The time stamps in the rwhod(8) network datagram and, based on that,
/var/rwho/whod.* spool files are typed as 32bit int and cannot accept
a 64bit time_t.
The old code clobbered the first bytes of the adjacent "hostname"
field, yielding empty hostnames in local rwho(1) and ruptime(1) output.
(Outgoing datagrams to other hosts were not affected.)
Re-code to let the compiler do the proper coercion (well, until 2038).
Submitted-by: Martin Neitzel
Dragonfly-bug: <https://bugs.dragonflybsd.org/issues/2339>
}
}
#endif
- time((time_t *)&wd.wd_recvtime);
+ wd.wd_recvtime = time(NULL);
write(whod, (char *)&wd, cc);
if (fstat(whod, &st) < 0 || st.st_size > cc)
ftruncate(whod, cc);