summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@nxc.no>2017-08-18 17:58:07 (GMT)
committer Sergey Poznyakoff <gray@nxc.no>2017-08-18 17:58:07 (GMT)
commitf8b326deb39ba2f07335ae63174b9d221350e1a4 (patch) (side-by-side diff)
treecbc89799c5913a0686605f677d60554383f785fb
parent41249de4eba7c7ab53849e511f3a59733244de9e (diff)
downloadnssync-f8b326deb39ba2f07335ae63174b9d221350e1a4.tar.gz
nssync-f8b326deb39ba2f07335ae63174b9d221350e1a4.tar.bz2
Bugfix
* src/timer.c (nssync_timer): Fix call to pthread_cond_timedwait.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--src/timer.c6
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;
}

Return to:

Send suggestions and report system problems to the System administrator.