X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fdaemon%2Fcollectd.c;h=ad069992414fb8fdb01dfa4d65ff911ed213a2e9;hb=40e77dd34f9a8466165a8b7d724faeb337c90414;hp=88c38acea0990e1aa8684959c55ca9e8d94877e1;hpb=649eff4e6f96ba72d693c1442acaa62abdf965e0;p=collectd.git diff --git a/src/daemon/collectd.c b/src/daemon/collectd.c index 88c38ace..ad069992 100644 --- 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