diff options
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/times.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/winsup/cygwin/times.cc b/winsup/cygwin/times.cc index a89980d..3c3ba92 100644 --- a/winsup/cygwin/times.cc +++ b/winsup/cygwin/times.cc @@ -490,7 +490,8 @@ clock_settime (clockid_t clk_id, const struct timespec *tp) return -1; } - if (clk_id != CLOCK_REALTIME_COARSE && clk_id != CLOCK_REALTIME) + if ((clk_id != CLOCK_REALTIME_COARSE && clk_id != CLOCK_REALTIME) + || tp->tv_nsec < 0) /* Otherwise -999...-1 would be accepted */ { set_errno (EINVAL); return -1; |