diff options
author | khali <khali@7894878c-1315-0410-8ee3-d5d059ff63e0> | 2010-08-18 20:00:28 +0000 |
---|---|---|
committer | khali <khali@7894878c-1315-0410-8ee3-d5d059ff63e0> | 2010-08-18 20:00:28 +0000 |
commit | bd126b24ad06287bf0677745630dea200ac0442e (patch) | |
tree | dd121deb41fd29de84e12c2ac4d6af0094043720 /tools | |
parent | ad2933bdbf4ffeee3abc11f01264084d84478236 (diff) | |
download | i2c-tools-bd126b24ad06287bf0677745630dea200ac0442e.tar.gz |
Properly handle the rare case where /dev/i2c exists but isn't a
directory. Patch from Florian Fainelli.
git-svn-id: http://lm-sensors.org/svn/i2c-tools/trunk@5854 7894878c-1315-0410-8ee3-d5d059ff63e0
Diffstat (limited to 'tools')
-rw-r--r-- | tools/i2cbusses.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/i2cbusses.c b/tools/i2cbusses.c index 693c191..ee0348c 100644 --- a/tools/i2cbusses.c +++ b/tools/i2cbusses.c @@ -378,7 +378,7 @@ int open_i2c_dev(const int i2cbus, char *filename, const int quiet) sprintf(filename, "/dev/i2c/%d", i2cbus); file = open(filename, O_RDWR); - if (file < 0 && errno == ENOENT) { + if (file < 0 && (errno == ENOENT || errno == ENOTDIR)) { sprintf(filename, "/dev/i2c-%d", i2cbus); file = open(filename, O_RDWR); } |