summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bb715b6)
raw | patch | inline | side by side (parent: bb715b6)
author | Florian Forster <octo@collectd.org> | |
Mon, 30 Nov 2015 19:27:24 +0000 (20:27 +0100) | ||
committer | Florian Forster <octo@collectd.org> | |
Mon, 30 Nov 2015 19:30:07 +0000 (20:30 +0100) |
Fixes: #1237
src/daemon/collectd.c | patch | blob | history |
diff --git a/src/daemon/collectd.c b/src/daemon/collectd.c
index 88c38acea0990e1aa8684959c55ca9e8d94877e1..ad069992414fb8fdb01dfa4d65ff911ed213a2e9 100644 (file)
--- a/src/daemon/collectd.c
+++ b/src/daemon/collectd.c
#if HAVE_SETLOCALE
if (setlocale (LC_NUMERIC, COLLECTD_LOCALE) == NULL)
WARNING ("setlocale (\"%s\") failed.", COLLECTD_LOCALE);
+
+ /* Update the environment, so that libraries that are calling
+ * setlocale(LC_NUMERIC, "") don't accidentally revert these changes. */
+ unsetenv ("LC_ALL");
+ setenv ("LC_NUMERIC", COLLECTD_LOCALE, /* overwrite = */ 1);
#endif
#if HAVE_LIBKSTAT