From: Irina Tirdea Date: Fri, 24 Jul 2015 13:28:06 +0000 (+0300) Subject: tools: iio: print error message when buffer enable fails X-Git-Tag: v4.9.8~3706^2~139^2~44 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e7231491ce6ae2053569166f60835a5594b3c0af;p=platform%2Fkernel%2Flinux-rpi3.git tools: iio: print error message when buffer enable fails Running generic_buffer without enabling any channel of the sensor will fail without printing any error message. Add an error message that indicates buffer enable failed. Signed-off-by: Irina Tirdea Acked-by: Hartmut Knaack Signed-off-by: Jonathan Cameron --- diff --git a/tools/iio/generic_buffer.c b/tools/iio/generic_buffer.c index 32f389eb..9f7b85b 100644 --- a/tools/iio/generic_buffer.c +++ b/tools/iio/generic_buffer.c @@ -364,8 +364,11 @@ int main(int argc, char **argv) /* Enable the buffer */ ret = write_sysfs_int("enable", buf_dir_name, 1); - if (ret < 0) + if (ret < 0) { + fprintf(stderr, + "Failed to enable buffer: %s\n", strerror(-ret)); goto error_free_buf_dir_name; + } scan_size = size_from_channelarray(channels, num_channels); data = malloc(scan_size * buf_len);