rdate: make it do something remotely sane, facing 32-bit time overflow

function                                             old     new   delta
rdate_main                                           251     254      +3
packed_usage                                       31029   31023      -6

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2017-01-20 16:03:48 +01:00
parent 19e695ebad
commit 179e88bec9
2 changed files with 27 additions and 6 deletions

View File

@ -1677,7 +1677,7 @@ static uint32_t machtime(void)
struct timeval tv;
gettimeofday(&tv, NULL);
return htonl((uint32_t)(tv.tv_sec + 2208988800));
return htonl((uint32_t)(tv.tv_sec + 2208988800U));
}
/* ARGSUSED */
static void FAST_FUNC machtime_stream(int s, servtab_t *sep UNUSED_PARAM)