This commit is contained in:
parent
752962bd25
commit
80f61173aa
13
lm_sensors-ignore-missing-device-link.patch
Normal file
13
lm_sensors-ignore-missing-device-link.patch
Normal file
@ -0,0 +1,13 @@
|
||||
Index: lib/sysfs.c
|
||||
===================================================================
|
||||
--- lib/sysfs.c.orig
|
||||
+++ lib/sysfs.c
|
||||
@@ -593,7 +593,7 @@ static int sensors_add_hwmon_device(cons
|
||||
snprintf(linkpath, NAME_MAX, "%s/device", path);
|
||||
dev_len = readlink(linkpath, device, NAME_MAX - 1);
|
||||
if (dev_len < 0)
|
||||
- return -SENSORS_ERR_KERNEL;
|
||||
+ return 0;
|
||||
device[dev_len] = '\0';
|
||||
device_p = strrchr(device, '/') + 1;
|
||||
|
65
lm_sensors-r5169-parse-config-in-C-locale.patch
Normal file
65
lm_sensors-r5169-parse-config-in-C-locale.patch
Normal file
@ -0,0 +1,65 @@
|
||||
Index: lib/init.c
|
||||
===================================================================
|
||||
--- lib/init.c.orig
|
||||
+++ lib/init.c
|
||||
@@ -18,8 +18,10 @@
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
+#include <locale.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
+#include <string.h>
|
||||
#include <errno.h>
|
||||
#include "sensors.h"
|
||||
#include "data.h"
|
||||
@@ -33,6 +35,31 @@
|
||||
#define DEFAULT_CONFIG_FILE ETCDIR "/sensors3.conf"
|
||||
#define ALT_CONFIG_FILE ETCDIR "/sensors.conf"
|
||||
|
||||
+/* Wrapper around sensors_yyparse(), which clears the locale so that
|
||||
+ the decimal numbers are always parsed properly. */
|
||||
+static int sensors_parse(void)
|
||||
+{
|
||||
+ int res;
|
||||
+ char *locale;
|
||||
+
|
||||
+ /* Remember the current locale and clear it */
|
||||
+ locale = setlocale(LC_ALL, NULL);
|
||||
+ if (locale) {
|
||||
+ locale = strdup(locale);
|
||||
+ setlocale(LC_ALL, "C");
|
||||
+ }
|
||||
+
|
||||
+ res = sensors_yyparse();
|
||||
+
|
||||
+ /* Restore the old locale */
|
||||
+ if (locale) {
|
||||
+ setlocale(LC_ALL, locale);
|
||||
+ free(locale);
|
||||
+ }
|
||||
+
|
||||
+ return res;
|
||||
+}
|
||||
+
|
||||
int sensors_init(FILE *input)
|
||||
{
|
||||
int res;
|
||||
@@ -46,7 +73,7 @@ int sensors_init(FILE *input)
|
||||
res = -SENSORS_ERR_PARSE;
|
||||
if (input) {
|
||||
if (sensors_scanner_init(input) ||
|
||||
- sensors_yyparse())
|
||||
+ sensors_parse())
|
||||
goto exit_cleanup;
|
||||
} else {
|
||||
/* No configuration provided, use default */
|
||||
@@ -55,7 +82,7 @@ int sensors_init(FILE *input)
|
||||
input = fopen(ALT_CONFIG_FILE, "r");
|
||||
if (input) {
|
||||
if (sensors_scanner_init(input) ||
|
||||
- sensors_yyparse()) {
|
||||
+ sensors_parse()) {
|
||||
fclose(input);
|
||||
goto exit_cleanup;
|
||||
}
|
24
lm_sensors-r5175-compute-statements-override.patch
Normal file
24
lm_sensors-r5175-compute-statements-override.patch
Normal file
@ -0,0 +1,24 @@
|
||||
Index: lib/access.c
|
||||
===================================================================
|
||||
--- lib/access.c.orig
|
||||
+++ lib/access.c
|
||||
@@ -248,7 +248,8 @@ int sensors_get_value(const sensors_chip
|
||||
subfeature->mapping);
|
||||
|
||||
chip = NULL;
|
||||
- while ((chip = sensors_for_all_config_chips(name, chip)))
|
||||
+ while (!expr &&
|
||||
+ (chip = sensors_for_all_config_chips(name, chip)))
|
||||
for (i = 0; i < chip->computes_count; i++) {
|
||||
if (!strcmp(feature->name,
|
||||
chip->computes[i].name)) {
|
||||
@@ -299,7 +300,8 @@ int sensors_set_value(const sensors_chip
|
||||
subfeature->mapping);
|
||||
|
||||
chip = NULL;
|
||||
- while ((chip = sensors_for_all_config_chips(name, chip)))
|
||||
+ while (!expr &&
|
||||
+ (chip = sensors_for_all_config_chips(name, chip)))
|
||||
for (i = 0; i < chip->computes_count; i++) {
|
||||
if (!strcmp(feature->name,
|
||||
chip->computes[i].name)) {
|
@ -1,3 +1,14 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Apr 16 18:37:39 CEST 2008 - jdelvare@suse.de
|
||||
|
||||
- lm_sensors-r5169-parse-config-in-C-locale.patch: Parse the
|
||||
configuration file in C locale.
|
||||
- lm_sensors-r5175-compute-statements-override.patch: Late compute
|
||||
statements should override early ones.
|
||||
- lm_sensors-ignore-missing-device-link.patch: Don't choke on
|
||||
hwmon devices with no device link. The new thermal zone code that
|
||||
went into kernel 2.6.25-rc5-git4 creates one such hwmon device.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Apr 10 12:54:45 CEST 2008 - ro@suse.de
|
||||
|
||||
|
16
sensors.spec
16
sensors.spec
@ -15,7 +15,7 @@ Name: sensors
|
||||
BuildRequires: bison flex rrdtool-devel
|
||||
Url: http://www.lm-sensors.org/
|
||||
Version: 3.0.1
|
||||
Release: 21
|
||||
Release: 23
|
||||
Summary: Hardware health monitoring for Linux
|
||||
License: GPL v2 or later
|
||||
Group: System/Monitoring
|
||||
@ -25,6 +25,9 @@ Source0: lm_sensors-3.0.1.tar.bz2
|
||||
Patch: lm_sensors-3.0.1.dif
|
||||
Patch1: lm_sensors-3.0.0-sensord-separate.dif
|
||||
Patch2: lm_sensors-3.0.0-sysconfig_metadata.patch
|
||||
Patch3: lm_sensors-r5169-parse-config-in-C-locale.patch
|
||||
Patch4: lm_sensors-r5175-compute-statements-override.patch
|
||||
Patch5: lm_sensors-ignore-missing-device-link.patch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
ExcludeArch: s390 s390x
|
||||
|
||||
@ -125,6 +128,9 @@ Authors:
|
||||
%patch
|
||||
%patch1
|
||||
%patch2
|
||||
%patch3
|
||||
%patch4
|
||||
%patch5
|
||||
|
||||
%build
|
||||
RPM_OPT_FLAGS="$RPM_OPT_FLAGS"
|
||||
@ -200,6 +206,14 @@ rm -f $RPM_BUILD_ROOT/usr/src/linux/include/sensors.h
|
||||
%doc /usr/share/man/man3/*.3.gz
|
||||
|
||||
%changelog
|
||||
* Wed Apr 16 2008 jdelvare@suse.de
|
||||
- lm_sensors-r5169-parse-config-in-C-locale.patch: Parse the
|
||||
configuration file in C locale.
|
||||
- lm_sensors-r5175-compute-statements-override.patch: Late compute
|
||||
statements should override early ones.
|
||||
- lm_sensors-ignore-missing-device-link.patch: Don't choke on
|
||||
hwmon devices with no device link. The new thermal zone code that
|
||||
went into kernel 2.6.25-rc5-git4 creates one such hwmon device.
|
||||
* Thu Apr 10 2008 ro@suse.de
|
||||
- added baselibs.conf file to build xxbit packages
|
||||
for multilib support
|
||||
|
Loading…
Reference in New Issue
Block a user