Date: Tue, 6 Aug 2013 15:49:18 +0000 (UTC) From: Hiroki Sato <hrs@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253995 - in head/usr.sbin: rtadvd rtsold Message-ID: <201308061549.r76FnImt054058@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hrs Date: Tue Aug 6 15:49:18 2013 New Revision: 253995 URL: http://svnweb.freebsd.org/changeset/base/253995 Log: Fix build on arm and mips. Modified: head/usr.sbin/rtadvd/timer.c head/usr.sbin/rtsold/rtsold.c Modified: head/usr.sbin/rtadvd/timer.c ============================================================================== --- head/usr.sbin/rtadvd/timer.c Tue Aug 6 15:34:11 2013 (r253994) +++ head/usr.sbin/rtadvd/timer.c Tue Aug 6 15:49:18 2013 (r253995) @@ -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); } Modified: head/usr.sbin/rtsold/rtsold.c ============================================================================== --- head/usr.sbin/rtsold/rtsold.c Tue Aug 6 15:34:11 2013 (r253994) +++ head/usr.sbin/rtsold/rtsold.c Tue Aug 6 15:49:18 2013 (r253995) @@ -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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308061549.r76FnImt054058>