[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox
Subject: Re: [PATCH 6/6] i2cdump: display the numeric value for block read ioctl() errors
From: Denys Vlasenko <vda.linux () googlemail ! com>
Date: 2015-11-01 20:01:28
Message-ID: CAK1hOcPRckPG4JXMVOUKLNW67YORyuC8sDNMbeu_jNF6B904dQ () mail ! gmail ! com
[Download RAW message or body]
Applied all six patches. Thanks!
On Tue, Oct 27, 2015 at 5:15 PM, Bartosz Golaszewski
<bartekgola@gmail.com> wrote:
> This makes busybox i2cdump compatible with the upstream version, which
> also displays the numeric error value in case of a block read failure.
>
> Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
> ---
> miscutils/i2c_tools.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/miscutils/i2c_tools.c b/miscutils/i2c_tools.c
> index c8125eb..7563593 100644
> --- a/miscutils/i2c_tools.c
> +++ b/miscutils/i2c_tools.c
> @@ -732,8 +732,10 @@ static int read_block_data(int buf_fd, int mode, int *block)
> tmp = i2c_smbus_read_i2c_block_data(
> buf_fd, res, I2C_SMBUS_BLOCK_MAX,
> cblock + res);
> - if (tmp <= 0)
> + if (tmp <= 0) {
> + blen = tmp;
> goto fail;
> + }
> }
>
> if (res >= I2CDUMP_NUM_REGS)
> @@ -750,7 +752,7 @@ static int read_block_data(int buf_fd, int mode, int *block)
> return blen;
>
> fail:
> - bb_error_msg_and_die("block read failed");
> + bb_error_msg_and_die("block read failed: %d", blen);
> }
>
> /* Dump all but word data. */
> --
> 2.1.4
>
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic