1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-13 10:02:38 +00:00

Fix linux_alarm, the linux behaviour is to limit the

secs to INT_MAX when the passed in parameter is bigger
than INT_MAX.

Submitted by:	Dmitry Chagin <chagin.dmitry gmail com>
Approved by:	kib (mentor)
This commit is contained in:
Roman Divacky 2008-07-23 17:19:02 +00:00
parent a9337121a7
commit 0864e2a4f1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=180766

View File

@ -170,17 +170,20 @@ int
linux_alarm(struct thread *td, struct linux_alarm_args *args)
{
struct itimerval it, old_it;
u_int secs;
int error;
#ifdef DEBUG
if (ldebug(alarm))
printf(ARGS(alarm, "%u"), args->secs);
#endif
secs = args->secs;
if (args->secs > 100000000)
return (EINVAL);
if (secs > INT_MAX)
secs = INT_MAX;
it.it_value.tv_sec = (long)args->secs;
it.it_value.tv_sec = (long) secs;
it.it_value.tv_usec = 0;
it.it_interval.tv_sec = 0;
it.it_interval.tv_usec = 0;