aboutsummaryrefslogtreecommitdiff
path: root/src/common/compat_pthreads.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-01-21 12:22:41 -0500
committerNick Mathewson <nickm@torproject.org>2015-01-21 12:26:41 -0500
commit3c8dabf69aa950c2df49f48aebbe02aac5b519f3 (patch)
tree20ddc7cca8132bc719f7e753223693a381ac6f04 /src/common/compat_pthreads.c
parentac5b70c700b211008853b5f212100a867f508dfd (diff)
downloadtor-3c8dabf69aa950c2df49f48aebbe02aac5b519f3.tar.gz
tor-3c8dabf69aa950c2df49f48aebbe02aac5b519f3.zip
Fix up some workqueue/threading issues spotted by dgoulet.
Diffstat (limited to 'src/common/compat_pthreads.c')
-rw-r--r--src/common/compat_pthreads.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/common/compat_pthreads.c b/src/common/compat_pthreads.c
index 188a91f68d..c217c5145b 100644
--- a/src/common/compat_pthreads.c
+++ b/src/common/compat_pthreads.c
@@ -212,7 +212,8 @@ tor_cond_wait(tor_cond_t *cond, tor_mutex_t *mutex, const struct timeval *tv)
struct timespec ts;
struct timeval tvnow, tvsum;
while (1) {
- gettimeofday(&tvnow, NULL);
+ if (gettimeofday(&tvnow, NULL) < 0)
+ return -1;
timeradd(tv, &tvnow, &tvsum);
ts.tv_sec = tvsum.tv_sec;
ts.tv_nsec = tvsum.tv_usec * 1000;