From: Mathieu Desnoyers Date: Thu, 25 Aug 2011 16:36:08 +0000 (-0400) Subject: metadata: fix wait handling X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=b472cfc0aede5a39d27893346bc6dff8856f6891;p=ust.git metadata: fix wait handling Signed-off-by: Mathieu Desnoyers --- diff --git a/include/ust/wait.h b/include/ust/wait.h index 21ced50..6cc0e37 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 c99b668..94d57c3 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"));