diff options
Diffstat (limited to 'src/timer.c')
-rw-r--r-- | src/timer.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/timer.c b/src/timer.c index e0f0928..d20e85c 100644 --- a/src/timer.c +++ b/src/timer.c @@ -81,6 +81,7 @@ nssync_timer(void *arg) { pthread_mutex_lock(&mtx); while (1) { + int rc; struct timespec ts; getts(&ts); if (debug_level >= 1) { @@ -89,11 +90,10 @@ nssync_timer(void *arg) buf[24] = 0; debug_printf("sleeping till %s", buf); } - if (pthread_cond_timedwait(&cond, &mtx, &ts)) { - if (errno && errno != ETIMEDOUT) { + if (rc = pthread_cond_timedwait(&cond, &mtx, &ts)) { + if (rc != ETIMEDOUT) { error("pthread_cond_timedwait: %s", strerror(errno)); - abort(); } else wake_up = 1; } |