fix duration handling in sigtimedwait

This commit is contained in:
Mark Geisert 2018-07-19 02:35:40 -07:00 committed by Corinna Vinschen
parent 6d7e0b337c
commit 3e51cc478d
2 changed files with 5 additions and 0 deletions

View File

@ -44,3 +44,6 @@ Bug Fixes
- Handle a non-standard return value from some tape drives to
report a "no-media" error.
Addresses: https://cygwin.com/ml/cygwin/2018-06/msg00245.html
- Fix duration handling in sigtimedwait
Addresses: https://cygwin.com/ml/cygwin-patches/2018-q3/msg00018.html

View File

@ -640,6 +640,8 @@ sigtimedwait (const sigset_t *set, siginfo_t *info, const timespec *timeout)
waittime.QuadPart = (LONGLONG) timeout->tv_sec * NS100PERSEC
+ ((LONGLONG) timeout->tv_nsec + (NSPERSEC/NS100PERSEC) - 1)
/ (NSPERSEC/NS100PERSEC);
/* negate waittime to code as duration for NtSetTimer() below cygwait() */
waittime.QuadPart = -waittime.QuadPart;
}
return sigwait_common (set, info, timeout ? &waittime : cw_infinite);