linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Hartmut Knaack <knaack.h@gmx.de>, linux-iio@vger.kernel.org
Cc: Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald <pmeerw@pmeerw.net>,
	Roberta Dobrescu <roberta.dobrescu@gmail.com>,
	Daniel Baluta <daniel.baluta@intel.com>,
	Irina Tirdea <irina.tirdea@intel.com>
Subject: Re: [PATCH v2 1/3] tools:iio:iio_event_monitor: check if event is fully read
Date: Sun, 21 Jun 2015 16:21:01 +0100	[thread overview]
Message-ID: <5586D65D.6050706@kernel.org> (raw)
In-Reply-To: <52e7c9b1da4e0918722cc993bd3b25287f342e55.1433721755.git.knaack.h@gmx.de>

On 10/06/15 20:51, Hartmut Knaack wrote:
> Check that the read event is of the expected size.
> 
> Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
Hartmut pointed out I hadn't picked this up.
I got lost in the thread, and missed that no one seemed
to actually have an issue with the patch, just related
questions!

Applied to the togreg branch of iio.git

Thanks

Jonathan
> ---
>  tools/iio/iio_event_monitor.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/tools/iio/iio_event_monitor.c b/tools/iio/iio_event_monitor.c
> index 016760e..2559fba 100644
> --- a/tools/iio/iio_event_monitor.c
> +++ b/tools/iio/iio_event_monitor.c
> @@ -299,6 +299,12 @@ int main(int argc, char **argv)
>  			}
>  		}
>  
> +		if (ret != sizeof(event)) {
> +			printf("Reading event failed!\n");
> +			ret = -EIO;
> +			break;
> +		}
> +
>  		print_event(&event);
>  	}
>  
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in

  parent reply	other threads:[~2015-06-21 15:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-10 19:51 [PATCH v2 0/3] iio-tools out-of-staging cleanup Hartmut Knaack
2015-06-10 19:51 ` [PATCH v2 1/3] tools:iio:iio_event_monitor: check if event is fully read Hartmut Knaack
2015-06-10 20:16   ` Daniel Baluta
2015-06-13  8:36     ` Hartmut Knaack
2015-06-13  8:46       ` Daniel Baluta
2015-06-13 10:00         ` Hartmut Knaack
2015-06-13 11:11           ` Cristina Georgiana Opriceana
2015-06-21 15:21   ` Jonathan Cameron [this message]
2015-06-10 19:51 ` [PATCH v2 2/3] tools:iio: adjust coding style Hartmut Knaack
2015-06-13 17:53   ` Jonathan Cameron
2015-06-10 19:51 ` [PATCH v2 3/3] tools:iio: rename variables Hartmut Knaack

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=5586D65D.6050706@kernel.org \
    --to=jic23@kernel.org \
    --cc=daniel.baluta@intel.com \
    --cc=irina.tirdea@intel.com \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=roberta.dobrescu@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).