diff options
author | pjd <pjd@FreeBSD.org> | 2010-11-01 10:41:05 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2010-11-01 10:41:05 +0000 |
commit | 2133f19a2da5b78ecbd0a26057b3ebd1e1f1f794 (patch) | |
tree | 29c6c84b142bc137685206cee22d91d2b22d23e8 /cddl | |
parent | 0fbc128e602df74c4eca7289d17d2c11e5596ce3 (diff) | |
download | FreeBSD-src-2133f19a2da5b78ecbd0a26057b3ebd1e1f1f794.zip FreeBSD-src-2133f19a2da5b78ecbd0a26057b3ebd1e1f1f794.tar.gz |
1. Remove invalid assertion.
2. Properly recalculate delta in case pthread_cond_timedwait() is interrupted.
3. Style fix.
Reported by: [1] App Deb <appdebgr@gmail.com>
Diffstat (limited to 'cddl')
-rw-r--r-- | cddl/contrib/opensolaris/lib/libzpool/common/kernel.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c b/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c index e0f6422..ca68ca1 100644 --- a/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c +++ b/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c @@ -308,9 +308,9 @@ cv_timedwait(kcondvar_t *cv, kmutex_t *mp, clock_t abstime) struct timeval tv; clock_t delta; - ASSERT(abstime > 0); + abstime += lbolt; top: - delta = abstime; + delta = abstime - lbolt; if (delta <= 0) return (-1); @@ -321,7 +321,7 @@ top: ts.tv_nsec = tv.tv_usec * 1000 + (delta % hz) * (NANOSEC / hz); ASSERT(ts.tv_nsec >= 0); - if(ts.tv_nsec >= NANOSEC) { + if (ts.tv_nsec >= NANOSEC) { ts.tv_sec++; ts.tv_nsec -= NANOSEC; } |