summaryrefslogtreecommitdiff
path: root/user/mate-sensors-applet/locale-guards.patch
blob: d3a35b92b2457a32fb48abb402c14e7a869fee4a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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;
 }