Force the use of the POSIX C locale for all commands and their subprocesses

This commit is contained in:
practicalswift
2018-04-25 12:55:34 +02:00
committed by Christian Decker
parent 52c243852e
commit abf510740d
38 changed files with 102 additions and 3 deletions

View File

@@ -2,6 +2,7 @@
#include <ccan/list/list.h>
#include <ccan/str/hex/hex.h>
#include <ccan/tal/str/str.h>
#include <locale.h>
secp256k1_context *secp256k1_ctx;
const tal_t *tmpctx;
@@ -26,6 +27,13 @@ u8 *tal_hexdata(const tal_t *ctx, const void *str, size_t len)
return data;
}
/* Use the POSIX C locale. */
void setup_locale(void)
{
setlocale(LC_ALL, "C");
putenv("LC_ALL=C"); /* For exec{l,lp,v,vp}(...) */
}
/* Global temporary convenience context: freed in io loop core. */
/* Initial creation of tmpctx. */