-/* $OpenBSD: synch.h,v 1.7 2021/06/13 21:11:54 kettenis Exp $ */
+/* $OpenBSD: synch.h,v 1.8 2023/11/08 15:51:28 cheloha Exp $ */
/*
* Copyright (c) 2017 Martin Pieuchot
*
return error;
}
- if (abs->tv_nsec >= 1000000000 || WRAP(clock_gettime)(clockid, &rel))
+ if (!timespecisvalid(abs) || WRAP(clock_gettime)(clockid, &rel))
return EINVAL;
rel.tv_sec = abs->tv_sec - rel.tv_sec;
-/* $OpenBSD: synch.h,v 1.8 2021/06/13 21:11:54 kettenis Exp $ */
+/* $OpenBSD: synch.h,v 1.9 2023/11/08 15:51:28 cheloha Exp $ */
/*
* Copyright (c) 2017 Martin Pieuchot
*
return error;
}
- if (abs->tv_nsec >= 1000000000 || clock_gettime(clockid, &rel))
+ if (!timespecisvalid(abs) || clock_gettime(clockid, &rel))
return EINVAL;
rel.tv_sec = abs->tv_sec - rel.tv_sec;