diff options
author | davidxu <davidxu@FreeBSD.org> | 2005-06-22 22:35:49 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2005-06-22 22:35:49 +0000 |
commit | fab6f17360611cadc3d67e159eb23e8e09b1f97d (patch) | |
tree | 4c87c8c6e821f85afb859572385ffe170b99f8ab /lib | |
parent | 1a463a3cbed8b7686cb6a7e4365cce6c69f3255a (diff) | |
download | FreeBSD-src-fab6f17360611cadc3d67e159eb23e8e09b1f97d.zip FreeBSD-src-fab6f17360611cadc3d67e159eb23e8e09b1f97d.tar.gz |
Fix off-by-one nanosecond in macro TIMESPEC_ADD.
Reviewed by: deischen
Approved by: re (dwhite)
MFC after : 4 days
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libkse/thread/thr_private.h | 2 | ||||
-rw-r--r-- | lib/libpthread/thread/thr_private.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/libkse/thread/thr_private.h b/lib/libkse/thread/thr_private.h index c629038..e2055bc 100644 --- a/lib/libkse/thread/thr_private.h +++ b/lib/libkse/thread/thr_private.h @@ -106,7 +106,7 @@ do { \ (dst)->tv_sec = (src)->tv_sec + (val)->tv_sec; \ (dst)->tv_nsec = (src)->tv_nsec + (val)->tv_nsec; \ - if ((dst)->tv_nsec > 1000000000) { \ + if ((dst)->tv_nsec >= 1000000000) { \ (dst)->tv_sec++; \ (dst)->tv_nsec -= 1000000000; \ } \ diff --git a/lib/libpthread/thread/thr_private.h b/lib/libpthread/thread/thr_private.h index c629038..e2055bc 100644 --- a/lib/libpthread/thread/thr_private.h +++ b/lib/libpthread/thread/thr_private.h @@ -106,7 +106,7 @@ do { \ (dst)->tv_sec = (src)->tv_sec + (val)->tv_sec; \ (dst)->tv_nsec = (src)->tv_nsec + (val)->tv_nsec; \ - if ((dst)->tv_nsec > 1000000000) { \ + if ((dst)->tv_nsec >= 1000000000) { \ (dst)->tv_sec++; \ (dst)->tv_nsec -= 1000000000; \ } \ |