mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-28 12:05:47 +08:00
fix duration handling in sigtimedwait
This commit is contained in:
parent
6d7e0b337c
commit
3e51cc478d
@ -44,3 +44,6 @@ Bug Fixes
|
|||||||
- Handle a non-standard return value from some tape drives to
|
- Handle a non-standard return value from some tape drives to
|
||||||
report a "no-media" error.
|
report a "no-media" error.
|
||||||
Addresses: https://cygwin.com/ml/cygwin/2018-06/msg00245.html
|
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
|
||||||
|
@ -640,6 +640,8 @@ sigtimedwait (const sigset_t *set, siginfo_t *info, const timespec *timeout)
|
|||||||
waittime.QuadPart = (LONGLONG) timeout->tv_sec * NS100PERSEC
|
waittime.QuadPart = (LONGLONG) timeout->tv_sec * NS100PERSEC
|
||||||
+ ((LONGLONG) timeout->tv_nsec + (NSPERSEC/NS100PERSEC) - 1)
|
+ ((LONGLONG) timeout->tv_nsec + (NSPERSEC/NS100PERSEC) - 1)
|
||||||
/ (NSPERSEC/NS100PERSEC);
|
/ (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);
|
return sigwait_common (set, info, timeout ? &waittime : cw_infinite);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user