From 01b7d448e22fda0721d8946fcbcd4bba3f6374c6 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sat, 15 Dec 2007 22:33:37 +0000 Subject: [PATCH] Return the correct error code on I2C block read failure. git-svn-id: http://lm-sensors.org/svn/i2c-tools/trunk@5073 7894878c-1315-0410-8ee3-d5d059ff63e0 --- CHANGES | 1 + tools/i2cdump.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 00b80fd..66cddbe 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,7 @@ SVN decode-vaio: Private data might not be readable by non-root users Print the asset tag Fix the timestamp decoding + i2cdump: Fix I2C block mode error code i2cset: Final status messages go to stdout Return success even when readback fails or doesn't match i2c-stub-from-dump: New helper script to use with i2c-stub diff --git a/tools/i2cdump.c b/tools/i2cdump.c index d24d46d..8b0b86b 100644 --- a/tools/i2cdump.c +++ b/tools/i2cdump.c @@ -313,8 +313,10 @@ int main(int argc, char *argv[]) for (res = 0; res < 256; res += i) { i = i2c_smbus_read_i2c_block_data(file, res, 32, cblock + res); - if (i <= 0) + if (i <= 0) { + res = i; break; + } } } if (res <= 0) {