projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bb715b6
)
Set locale environment variables at startup.
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
88c38ac
..
ad06999
100644
(file)
--- a/
src/daemon/collectd.c
+++ b/
src/daemon/collectd.c
@@
-302,6
+302,11
@@
static int do_init (void)
#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