summaryrefslogtreecommitdiff
path: root/user/mate-sensors-applet/locale-guards.patch
diff options
context:
space:
mode:
Diffstat (limited to 'user/mate-sensors-applet/locale-guards.patch')
-rw-r--r--user/mate-sensors-applet/locale-guards.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/user/mate-sensors-applet/locale-guards.patch b/user/mate-sensors-applet/locale-guards.patch
new file mode 100644
index 000000000..d3a35b92b
--- /dev/null
+++ b/user/mate-sensors-applet/locale-guards.patch
@@ -0,0 +1,29 @@
+diff -Nurd mate-sensors-applet-1.24.0/plugins/i2c-proc/i2c-proc-plugin.c mate-sensors-applet-1.24.0.new/plugins/i2c-proc/i2c-proc-plugin.c
+--- mate-sensors-applet-1.24.0/plugins/i2c-proc/i2c-proc-plugin.c 2020-02-10 07:40:35.000000000 -0500
++++ mate-sensors-applet-1.24.0.new/plugins/i2c-proc/i2c-proc-plugin.c 2020-02-15 12:50:42.395405752 -0500
+@@ -144,9 +144,11 @@
+ gchar *old_locale = NULL;
+
+ /* always use C locale */
++#ifdef HAVE_LOCALE_H
+ if (NULL == (old_locale = setlocale(LC_NUMERIC, "C"))) {
+ g_warning("Could not change locale to C locale for reading i2c-proc device files.. will try regardless");
+ }
++#endif
+
+ if (NULL == (fp = fopen(path, "r"))) {
+ g_set_error(error, SENSORS_APPLET_PLUGIN_ERROR, I2C_PROC_DEVICE_FILE_OPEN_ERROR, "Error opening sensor device file %s", path);
+@@ -203,11 +205,11 @@
+ } /* end switch */
+ fclose(fp);
+ }
+-
++#ifdef HAVE_LOCALE_H
+ if (NULL != old_locale) {
+ setlocale(LC_NUMERIC, old_locale);
+ }
+-
++#endif
+ return (gdouble)sensor_value;
+ }
+