Cygwin: timerfd: move ioctl error handling into timerfd_tracker

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen
2019-01-21 12:41:00 +01:00
parent 528f4d4938
commit 289b7c09c8
3 changed files with 39 additions and 36 deletions

View File

@ -394,11 +394,18 @@ timerfd_tracker::close ()
InterlockedDecrement (&tfd_shared->instance_count);
}
void
timerfd_tracker::ioctl_set_ticks (uint64_t exp_cnt)
int
timerfd_tracker::ioctl_set_ticks (uint64_t new_exp_cnt)
{
LONG64 exp_cnt = (LONG64) new_exp_cnt;
if (exp_cnt == 0 || exp_cnt == -1LL)
return -EINVAL;
if (!enter_critical_section ())
return -EBADF;
set_expiration_count (exp_cnt);
timer_expired ();
leave_critical_section ();
return 0;
}
void