From a441a7710c993acb1e34e0c2e3129483c5758de0 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sun, 4 Feb 2007 20:54:02 +0000 Subject: [PATCH] i2cdetect, i2cdump, isadump: Flush the output in real time. That way it's easier to find out which specific address causes problem if the system freezes or the SMBus locks itself, for example. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4316 7894878c-1315-0410-8ee3-d5d059ff63e0 --- CHANGES | 1 + prog/detect/i2cdetect.c | 2 ++ prog/dump/i2cdump.c | 1 + prog/dump/isadump.c | 1 + 4 files changed, 5 insertions(+) diff --git a/CHANGES b/CHANGES index b7ac682c..6855df47 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,7 @@ lm_sensors CHANGES file SVN HEAD Man page i2cdetect.8: Scanning range can be restricted + Programs i2cdetect, i2cdump, isadump: Flush output in real time Program sensors-detect: Only probe relevant I2C addresses Drop ARP-capable device detection Add Maxim MAX6655/MAX6656 detection diff --git a/prog/detect/i2cdetect.c b/prog/detect/i2cdetect.c index c5e33e72..7bae2f8e 100644 --- a/prog/detect/i2cdetect.c +++ b/prog/detect/i2cdetect.c @@ -61,6 +61,8 @@ int scan_i2c_bus(int file, const int mode, const int first, const int last) for (i = 0; i < 128; i += 16) { printf("%02x: ", i); for(j = 0; j < 16; j++) { + fflush(stdout); + /* Skip unwanted addresses */ if (i+j < first || i+j > last) { printf(" "); diff --git a/prog/dump/i2cdump.c b/prog/dump/i2cdump.c index e46943c2..133e74da 100644 --- a/prog/dump/i2cdump.c +++ b/prog/dump/i2cdump.c @@ -345,6 +345,7 @@ int main(int argc, char *argv[]) for (i = 0; i < 256; i+=16) { printf("%02x: ", i); for (j = 0; j < 16; j++) { + fflush(stdout); if (size == I2C_SMBUS_BYTE_DATA) { block[i+j] = res = i2c_smbus_read_byte_data(file, i+j); diff --git a/prog/dump/isadump.c b/prog/dump/isadump.c index 7a89abe6..2862406d 100644 --- a/prog/dump/isadump.c +++ b/prog/dump/isadump.c @@ -298,6 +298,7 @@ int main(int argc, char *argv[]) superio_write_key(addrreg, enter_key); for (j = 0; j < 16; j++) { + fflush(stdout); if (flat) { res = inb(addrreg + i + j); } else {