Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751999AbbHBRj7 (ORCPT ); Sun, 2 Aug 2015 13:39:59 -0400 Received: from saturn.retrosnub.co.uk ([178.18.118.26]:45468 "EHLO saturn.retrosnub.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751417AbbHBRj6 (ORCPT ); Sun, 2 Aug 2015 13:39:58 -0400 Subject: Re: [PATCH v2 2/2] tools: iio: print error message when buffer enable fails To: Hartmut Knaack , Irina Tirdea , linux-iio@vger.kernel.org References: <1437744486-16456-1-git-send-email-irina.tirdea@intel.com> <1437744486-16456-3-git-send-email-irina.tirdea@intel.com> <55B282A8.40903@gmx.de> Cc: linux-kernel@vger.kernel.org From: Jonathan Cameron Message-ID: <55BE55EC.3010206@kernel.org> Date: Sun, 2 Aug 2015 18:39:56 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <55B282A8.40903@gmx.de> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1553 Lines: 48 On 24/07/15 19:23, Hartmut Knaack wrote: > Irina Tirdea schrieb am 24.07.2015 um 15:28: >> 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 Applied. Thanks Jonathan >> --- >> tools/iio/generic_buffer.c | 5 ++++- >> 1 file changed, 4 insertions(+), 1 deletion(-) >> >> 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); >> > > -- > To unsubscribe from this list: send the line "unsubscribe linux-iio" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/