From 70bb3c495e7d67f6076b571ab9b4ff18b9cde3d3 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sat, 25 Feb 2006 21:32:26 +0000 Subject: [PATCH] Fix device scan when no i2c support exists or no i2c bus driver is loaded. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@3261 7894878c-1315-0410-8ee3-d5d059ff63e0 --- lib/sysfs.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/sysfs.c b/lib/sysfs.c index fe13c6d7..88bcd02d 100644 --- a/lib/sysfs.c +++ b/lib/sysfs.c @@ -22,6 +22,7 @@ #include #include +#include #include #include "data.h" #include "error.h" @@ -171,12 +172,14 @@ int sensors_read_sysfs_bus(void) int ret = 0; if (!(cls = sysfs_open_class("i2c-adapter"))) { - ret = -SENSORS_ERR_PROC; + if (errno && errno != ENOENT) + ret = -SENSORS_ERR_PROC; goto exit0; } if (!(clsdevs = sysfs_get_class_devices(cls))) { - ret = -SENSORS_ERR_PROC; + if (errno) + ret = -SENSORS_ERR_PROC; goto exit1; }