Fix compilation on 32 bit architectures and use INT64_MAX instead of

LONG_MAX for the upper bound check.
This commit is contained in:
Stefan Eßer 2013-12-19 21:35:33 +00:00
parent 7455eb71a1
commit 774e8d906f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=259633

View File

@ -523,11 +523,14 @@ knote_fork(struct knlist *list, int pid)
* XXX: EVFILT_TIMER should perhaps live in kern_time.c beside the
* interval timer support code.
*/
static __inline sbintime_t
static __inline sbintime_t
timer2sbintime(intptr_t data)
{
if (data > LLONG_MAX / SBT_1MS)
return LLONG_MAX;
#ifdef __LP64__
if (data > INT64_MAX / SBT_1MS)
return INT64_MAX;
#endif
return (SBT_1MS * data);
}