All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Desfossez <jdesfossez@efficios.com>
To: dgoulet@efficios.com, mathieu.desnoyers@efficios.com
Cc: lttng-dev@lists.lttng.org, Julien Desfossez <jdesfossez@efficios.com>
Subject: [LTTNG-TOOLS 2.3 PATCH 1/2] Fix: return code of get_subbuff on metadata stream
Date: Mon,  5 Aug 2013 11:27:18 -0400	[thread overview]
Message-ID: <1375716439-24407-1-git-send-email-jdesfossez__956.73033870316$1375716511$gmane$org@efficios.com> (raw)

On error, the ioctl kernctl_get_next_subbuf returns -1 and sets errno to
a meaningful value but we were ignoring it. It was causing
lttng_kconsumer_read_subbuffer to return -1 (error) instead of -EAGAIN
(normal).

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
---
 src/common/kernel-consumer/kernel-consumer.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/common/kernel-consumer/kernel-consumer.c b/src/common/kernel-consumer/kernel-consumer.c
index 3086abe..f8978d2 100644
--- a/src/common/kernel-consumer/kernel-consumer.c
+++ b/src/common/kernel-consumer/kernel-consumer.c
@@ -851,7 +851,7 @@ ssize_t lttng_kconsumer_read_subbuffer(struct lttng_consumer_stream *stream,
 	/* Get the next subbuffer */
 	err = kernctl_get_next_subbuf(infd);
 	if (err != 0) {
-		ret = err;
+		ret = -errno;
 		/*
 		 * This is a debug message even for single-threaded consumer,
 		 * because poll() have more relaxed criterions than get subbuf,
-- 
1.7.10.4

             reply	other threads:[~2013-08-05 15:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-05 15:27 Julien Desfossez [this message]
     [not found] <1375716439-24407-1-git-send-email-jdesfossez@efficios.com>
2013-08-05 19:06 ` [LTTNG-TOOLS 2.3 PATCH 1/2] Fix: return code of get_subbuff on metadata stream Mathieu Desnoyers
     [not found] <1375641986-2278-1-git-send-email-jdesfossez@efficios.com>
2013-08-04 20:34 ` Mathieu Desnoyers
  -- strict thread matches above, loose matches on Subject: below --
2013-08-04 18:46 Julien Desfossez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='1375716439-24407-1-git-send-email-jdesfossez__956.73033870316$1375716511$gmane$org@efficios.com' \
    --to=jdesfossez@efficios.com \
    --cc=dgoulet@efficios.com \
    --cc=lttng-dev@lists.lttng.org \
    --cc=mathieu.desnoyers@efficios.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.