mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-12-05 22:08:19 +00:00
Do not attempt to read label files from procfs, they do not exist
there. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4792 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
44b77f38e4
commit
0ce944ad66
1 file changed
+6
-2
+6
-2
@@ -27,6 +27,7 @@
|
|||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include "proc.h"
|
#include "proc.h"
|
||||||
#include "general.h"
|
#include "general.h"
|
||||||
|
#include "sysfs.h"
|
||||||
|
|
||||||
static int sensors_do_this_chip_sets(sensors_chip_name name);
|
static int sensors_do_this_chip_sets(sensors_chip_name name);
|
||||||
|
|
||||||
@@ -149,8 +150,6 @@ int sensors_get_label(sensors_chip_name name, int feature, char **result)
|
|||||||
{
|
{
|
||||||
const sensors_chip *chip;
|
const sensors_chip *chip;
|
||||||
const sensors_chip_feature *featureptr;
|
const sensors_chip_feature *featureptr;
|
||||||
char buf[128], path[PATH_MAX];
|
|
||||||
FILE *f;
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
*result = NULL;
|
*result = NULL;
|
||||||
@@ -166,6 +165,10 @@ int sensors_get_label(sensors_chip_name name, int feature, char **result)
|
|||||||
goto sensors_get_label_exit;
|
goto sensors_get_label_exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sensors_found_sysfs) {
|
||||||
|
char buf[128], path[PATH_MAX];
|
||||||
|
FILE *f;
|
||||||
|
|
||||||
/* No user specified label, check for a _label sysfs file */
|
/* No user specified label, check for a _label sysfs file */
|
||||||
snprintf(path, PATH_MAX, "%s/%s_label", name.busname,
|
snprintf(path, PATH_MAX, "%s/%s_label", name.busname,
|
||||||
featureptr->data.name);
|
featureptr->data.name);
|
||||||
@@ -180,6 +183,7 @@ int sensors_get_label(sensors_chip_name name, int feature, char **result)
|
|||||||
goto sensors_get_label_exit;
|
goto sensors_get_label_exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* No label, return the feature name instead */
|
/* No label, return the feature name instead */
|
||||||
*result = strdup(featureptr->data.name);
|
*result = strdup(featureptr->data.name);
|
||||||
|
|||||||
Reference in new issue
Block a user