diff options
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/rtadvd/timer.c | 7 | ||||
-rw-r--r-- | usr.sbin/rtsold/rtsold.c | 6 |
2 files changed, 4 insertions, 9 deletions
diff --git a/usr.sbin/rtadvd/timer.c b/usr.sbin/rtadvd/timer.c index faa541d..452add4 100644 --- a/usr.sbin/rtadvd/timer.c +++ b/usr.sbin/rtadvd/timer.c @@ -59,11 +59,8 @@ void rtadvd_timer_init(void) { /* Generate maximum time in timespec. */ - memset(&tm_limit.tv_sec, 0xff, sizeof(tm_limit.tv_sec)); - memset(&tm_limit.tv_nsec, 0xff, sizeof(tm_limit.tv_nsec)); - tm_limit.tv_sec &= ~(1UL << (sizeof(tm_limit.tv_sec) * 8 - 1)); - tm_limit.tv_nsec &= ~(1UL << (sizeof(tm_limit.tv_nsec) * 8 - 1)); - + tm_limit.tv_sec = (-1) & ~((time_t)1 << ((sizeof(tm_max.tv_sec) * 8) - 1)); + tm_limit.tv_nsec = (-1) & ~((long)1 << ((sizeof(tm_max.tv_nsec) * 8) - 1)); tm_max = tm_limit; TAILQ_INIT(&ra_timer); } diff --git a/usr.sbin/rtsold/rtsold.c b/usr.sbin/rtsold/rtsold.c index 2826c2c..e62e9ff 100644 --- a/usr.sbin/rtsold/rtsold.c +++ b/usr.sbin/rtsold/rtsold.c @@ -188,10 +188,8 @@ main(int argc, char **argv) } /* Generate maximum time in timespec. */ - memset(&tm_max.tv_sec, 0xff, sizeof(tm_max.tv_sec)); - memset(&tm_max.tv_nsec, 0xff, sizeof(tm_max.tv_nsec)); - tm_max.tv_sec &= ~(1UL << (sizeof(tm_max.tv_sec) * 8 - 1)); - tm_max.tv_nsec &= ~(1UL << (sizeof(tm_max.tv_nsec) * 8 - 1)); + tm_max.tv_sec = (-1) & ~((time_t)1 << ((sizeof(tm_max.tv_sec) * 8) - 1)); + tm_max.tv_nsec = (-1) & ~((long)1 << ((sizeof(tm_max.tv_nsec) * 8) - 1)); /* set log level */ if (dflag > 1) |