mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-10-30 13:00:30 +00:00
Drop SENSORS_ERR_NO_DEVS: we return success, not error, when no device
is found. git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4879 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
38d16d299d
commit
6c229f7a3c
3 files changed
+6
-8
No files matched your search
+1
-2
@@ -35,14 +35,13 @@ static const char *errorlist[] = {
|
||||
/* Invalid error code */ NULL,
|
||||
/* SENSORS_ERR_WILDCARDS */ "Wildcard found in chip name",
|
||||
/* SENSORS_ERR_NO_ENTRY */ "No such subfeature known",
|
||||
/* SENSORS_ERR_NO_DEVS */ "No devices found",
|
||||
/* SENSORS_ERR_ACCESS_R */ "Can't read",
|
||||
/* SENSORS_ERR_KERNEL */ "Kernel interface error",
|
||||
/* SENSORS_ERR_DIV_ZERO */ "Divide by zero",
|
||||
/* SENSORS_ERR_CHIP_NAME */ "Can't parse chip name",
|
||||
/* SENSORS_ERR_BUS_NAME */ "Can't parse bus name",
|
||||
/* SENSORS_ERR_PARSE */ "General parse error",
|
||||
/* SENSORS_ERR_ACCESS_W */ "Can't write",
|
||||
/* SENSORS_ERR_ACCESS_R */ "Can't read",
|
||||
};
|
||||
|
||||
const char *sensors_strerror(int errnum)
|
||||
|
||||
+1
-2
@@ -23,14 +23,13 @@
|
||||
|
||||
#define SENSORS_ERR_WILDCARDS 1 /* Wildcard found in chip name */
|
||||
#define SENSORS_ERR_NO_ENTRY 2 /* No such subfeature known */
|
||||
#define SENSORS_ERR_NO_DEVS 3 /* No devices found */
|
||||
#define SENSORS_ERR_ACCESS_R 3 /* Can't read */
|
||||
#define SENSORS_ERR_KERNEL 4 /* Kernel interface error */
|
||||
#define SENSORS_ERR_DIV_ZERO 5 /* Divide by zero */
|
||||
#define SENSORS_ERR_CHIP_NAME 6 /* Can't parse chip name */
|
||||
#define SENSORS_ERR_BUS_NAME 7 /* Can't parse bus name */
|
||||
#define SENSORS_ERR_PARSE 8 /* General parse error */
|
||||
#define SENSORS_ERR_ACCESS_W 9 /* Can't write */
|
||||
#define SENSORS_ERR_ACCESS_R 10 /* Can't read */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
+4
-4
@@ -437,13 +437,13 @@ static int sensors_read_sysfs_chips_compat(void)
|
||||
|
||||
if (!(bus = sysfs_open_bus("i2c"))) {
|
||||
if (errno && errno != ENOENT)
|
||||
ret = -SENSORS_ERR_NO_DEVS;
|
||||
ret = -SENSORS_ERR_KERNEL;
|
||||
goto exit0;
|
||||
}
|
||||
|
||||
if (!(devs = sysfs_get_bus_devices(bus))) {
|
||||
if (errno && errno != ENOENT)
|
||||
ret = -SENSORS_ERR_NO_DEVS;
|
||||
ret = -SENSORS_ERR_KERNEL;
|
||||
goto exit1;
|
||||
}
|
||||
|
||||
@@ -474,14 +474,14 @@ int sensors_read_sysfs_chips(void)
|
||||
|
||||
if (!(clsdevs = sysfs_get_class_devices(cls))) {
|
||||
if (errno && errno != ENOENT)
|
||||
ret = -SENSORS_ERR_NO_DEVS;
|
||||
ret = -SENSORS_ERR_KERNEL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
dlist_for_each_data(clsdevs, clsdev, struct sysfs_class_device) {
|
||||
struct sysfs_device *dev;
|
||||
if (!(dev = sysfs_get_classdev_device(clsdev))) {
|
||||
ret = -SENSORS_ERR_NO_DEVS;
|
||||
ret = -SENSORS_ERR_KERNEL;
|
||||
goto exit;
|
||||
}
|
||||
if ((ret = sensors_read_one_sysfs_chip(dev)))
|
||||
|
||||
Reference in new issue
Block a user