From 8749948a1bc0aff24e493f89de40e2ff95a83baf Mon Sep 17 00:00:00 2001 From: Hartmut Knaack Date: Sun, 31 May 2015 14:39:56 +0200 Subject: [PATCH] tools:iio:generic_buffer: fix check of errno Since errno contains the value of any of the defined error names, a negation will not lead to the desired match. Signed-off-by: Hartmut Knaack Signed-off-by: Jonathan Cameron --- tools/iio/generic_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/iio/generic_buffer.c b/tools/iio/generic_buffer.c index 7635aeb93dc8..e01c80ec5a88 100644 --- a/tools/iio/generic_buffer.c +++ b/tools/iio/generic_buffer.c @@ -321,7 +321,7 @@ int main(int argc, char **argv) data, toread*scan_size); if (read_size < 0) { - if (errno == -EAGAIN) { + if (errno == EAGAIN) { printf("nothing available\n"); continue; } else