kevent(2): Bugfix for wrong EVFILT_TIMER timeouts

When using NOTE_NSECONDS in the kevent(2) API, US_TO_SBT should be
used instead of NS_TO_SBT, otherwise the timeout results are
misleading.

PR:		252539
Reviewed by:	kevans, kib
Approved by:	kevans
MFC after:	3 weeks
This commit is contained in:
Jan Kokemüller 2021-01-09 20:00:25 +01:00 committed by Gordon Bergling
parent c8eee7c0bf
commit 4d0c33be63

View File

@ -665,7 +665,7 @@ timer2sbintime(int64_t data, int flags)
if (secs > (SBT_MAX / SBT_1S))
return (SBT_MAX);
#endif
return (secs << 32 | US_TO_SBT(data % 1000000000));
return (secs << 32 | NS_TO_SBT(data % 1000000000));
}
return (NS_TO_SBT(data));
default: