Browse Source

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 <knaack.h@gmx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Hartmut Knaack 10 years ago
parent
commit
8749948a1b
1 changed files with 1 additions and 1 deletions
  1. 1 1
      tools/iio/generic_buffer.c

+ 1 - 1
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