diff options
author | Erwin Lansing <erwin@FreeBSD.org> | 2012-12-05 12:53:50 +0000 |
---|---|---|
committer | Erwin Lansing <erwin@FreeBSD.org> | 2012-12-05 12:53:50 +0000 |
commit | a503af91a8a93bdaeb15b5467c2d98018eb719c5 (patch) | |
tree | dfe0c09893b34b160ac11d74d2862e8f52ed43fe /lib/isc/pthreads/condition.c | |
parent | 8d876c495fa11d5aa72e8340d4b6efa1e911030b (diff) |
Notes
Diffstat (limited to 'lib/isc/pthreads/condition.c')
-rw-r--r-- | lib/isc/pthreads/condition.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/isc/pthreads/condition.c b/lib/isc/pthreads/condition.c index 50281a2b87cb..9053cf0f1dd6 100644 --- a/lib/isc/pthreads/condition.c +++ b/lib/isc/pthreads/condition.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2005, 2007, 2012 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -43,7 +43,14 @@ isc_condition_waituntil(isc_condition_t *c, isc_mutex_t *m, isc_time_t *t) { * POSIX defines a timespec's tv_sec as time_t. */ result = isc_time_secondsastimet(t, &ts.tv_sec); - if (result != ISC_R_SUCCESS) + + /* + * If we have a range error ts.tv_sec is most probably a signed + * 32 bit value. Set ts.tv_sec to INT_MAX. This is a kludge. + */ + if (result == ISC_R_RANGE) + ts.tv_sec = INT_MAX; + else if (result != ISC_R_SUCCESS) return (result); /*! |