From: Mathieu Desnoyers Date: Thu, 25 Aug 2011 16:36:08 +0000 (-0400) Subject: metadata: fix wait handling X-Git-Tag: v1.9.1~257 X-Git-Url: http://git.lttng.org/?a=commitdiff_plain;h=b472cfc0aede5a39d27893346bc6dff8856f6891;hp=9dcb02efd18948134deb8469a39478f250033269;p=lttng-ust.git metadata: fix wait handling Signed-off-by: Mathieu Desnoyers --- diff --git a/include/ust/wait.h b/include/ust/wait.h index 21ced509..6cc0e373 100644 --- a/include/ust/wait.h +++ b/include/ust/wait.h @@ -30,7 +30,7 @@ int __timeout = _timeout; \ \ for (;;) { \ - if (!(_cond)) \ + if (_cond) \ break; \ if (__timeout <= 0) { \ __ret = -ETIMEDOUT; \ diff --git a/libust/ltt-events.c b/libust/ltt-events.c index c99b6689..94d57c33 100644 --- a/libust/ltt-events.c +++ b/libust/ltt-events.c @@ -402,7 +402,7 @@ int lttng_metadata_printf(struct ltt_session *session, ret != -ENOBUFS || !ret; }), LTTNG_METADATA_TIMEOUT_MSEC); - if (!waitret || waitret == -EINTR || ret) { + if (waitret == -ETIMEDOUT || waitret == -EINTR || ret) { DBG("LTTng: Failure to write metadata to buffers (%s)\n", waitret == -EINTR ? "interrupted" : (ret == -ENOBUFS ? "timeout" : "I/O error"));