From 291fd8c00c70a7bae76a351aefe23f851c02d5cb Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sat, 15 Dec 2007 22:35:17 +0000 Subject: [PATCH] Return the correct error code on I2C block read failure. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5074 7894878c-1315-0410-8ee3-d5d059ff63e0 --- CHANGES | 1 + prog/dump/i2cdump.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 4cacad8e..da3d6d68 100644 --- a/CHANGES +++ b/CHANGES @@ -14,6 +14,7 @@ SVN-HEAD Program decode-vaio.pl: Private data might not be readable by non-root users Print the asset tag Fix the timestamp decoding + Program i2cdump: Fix I2C block mode error code Program pwmconfig: Better diagnostics in pwmdisable Give the fans some time to spin up Really hide errors on sysfs writes diff --git a/prog/dump/i2cdump.c b/prog/dump/i2cdump.c index 062257a2..f677b58d 100644 --- a/prog/dump/i2cdump.c +++ b/prog/dump/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) {