mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 07:04:22 +01:00
Force the use of the POSIX C locale for all commands and their subprocesses
This commit is contained in:
committed by
Christian Decker
parent
52c243852e
commit
abf510740d
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user