Cygwin: clock.h: add valid_timespec() to check timespec for validity
Use throughout, drop local timespec_bad() in timer.cc. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
@@ -766,7 +766,7 @@ aiosuspend (const struct aiocb *const aiolist[],
|
||||
if (timeout)
|
||||
{
|
||||
to = *timeout;
|
||||
if (to.tv_sec < 0 || to.tv_nsec < 0 || to.tv_nsec > NSPERSEC)
|
||||
if (!valid_timespec (to))
|
||||
{
|
||||
set_errno (EINVAL);
|
||||
return -1;
|
||||
|
Reference in New Issue
Block a user