Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754366AbbGXSXt (ORCPT ); Fri, 24 Jul 2015 14:23:49 -0400 Received: from mout.gmx.net ([212.227.17.21]:56113 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753857AbbGXSXr (ORCPT ); Fri, 24 Jul 2015 14:23:47 -0400 Message-ID: <55B282A8.40903@gmx.de> Date: Fri, 24 Jul 2015 20:23:36 +0200 From: Hartmut Knaack User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0 SeaMonkey/2.33.1 MIME-Version: 1.0 To: Irina Tirdea , Jonathan Cameron , linux-iio@vger.kernel.org CC: linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/2] tools: iio: print error message when buffer enable fails References: <1437744486-16456-1-git-send-email-irina.tirdea@intel.com> <1437744486-16456-3-git-send-email-irina.tirdea@intel.com> In-Reply-To: <1437744486-16456-3-git-send-email-irina.tirdea@intel.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:xmlJy1u/VywcVrpHqWumkG8GQB/Fg9uEH1C+fiK+EtKxYpB9Rv5 JbJcpjlL0pB4u75bG+Bhc5WGyQEJMvCHgWc+kgT7XyrD8h485yo5ONFwc9NLeY+uvk9DQSf R72qe4K2A7n8FAruoK3sDH8s3wKUVj1nNo24lM7CnbFIrwWUM4o8vaFWZY4uluGnjPEIvav skl3G/ZfIgAqAKmEZo4Jg== X-UI-Out-Filterresults: notjunk:1;V01:K0:i5+M1E0q89k=:EEwpHsFWxQzvdZ5X8bee3y vzrdpOTUmuM7H3LgzBsR4z3LRYgYkvYf61wqiEaHPaE3C1tReLxABZ4lMJulZD4cNffPwkzPL taACV3jdedjjWcRkdsagX+qo8pwXbRxmIKsQJizbUX/myOulHV0ny6XmKv7jmAOuQiyFPsYmV G+up8XNqHVcT/MDBdfl6ZBKdt9NGLEtVu6vU7Kdv5Z7mQ2Sd0oeXsi0AYwmN3NVZ3d66efvBw SLUpYXK2XXDy83MCh22Bb9219SwYsmKcyv5D2eTwrAvTCKku8YuHaU5mvbI+1FWm6S1mNk11O h3BntaQw2tLaJ3jSGoBimFamhPZfif6I4sYl2g/Q2soyj/pOKwFdN+l2m8QP3MgoSwe3UwH6e dbLNaEJPomiAiYKP3OQQul64OwiBaE+yj/CaZhF3h1/8wVdQ+Xr6HHoZ5v4LLCANgkmBzehf6 cabBiH8zUnEKGnriYR06Fs1asqiUMJg6J1aBxJ41N1qlDaPY2sgHtkb8NjyTaI9rcFueW0lMO U7iunDT5QulLKp2aJ3XT9LRXDwOGGiV4UR2WgiQ5Eo5wZ/yY6l/Ehq3TJWCbsSgF2WZ3zWzyh IP7tmdUIkSYysT7G+RsHCLrlAvJHI/FkOQGp2SEiXqRXute7tTLuOje4Tcxjwk1MDr6hdXN4/ BZQPgVJ7/YPKUA6IgsrCXh1MaLvzJpUeagHT12e/murw0D1kWQvhntZe2M2lW+obV/N4= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1250 Lines: 36 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 > --- > 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-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/