Skip to content

Commit 6bf876d

Browse files
committed
broker: initialize locale
Problem: The broker does not initialize the current locale from the environment, so it may default to an ASCII-only locale (e.g. ANSI_X3.4-1968). Call setlocale (LC_ALL, ""); first thing in main() to ensure the locale is properly initialized from the current environment.
1 parent 1f13a17 commit 6bf876d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/broker/broker.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#endif
1414
#include <assert.h>
1515
#include <libgen.h>
16+
#include <locale.h>
1617
#include <inttypes.h>
1718
#include <sys/prctl.h>
1819
#include <sys/resource.h>
@@ -204,6 +205,8 @@ int main (int argc, char *argv[])
204205
const char *method;
205206
flux_error_t error;
206207

208+
setlocale (LC_ALL, "");
209+
207210
memset (&ctx, 0, sizeof (ctx));
208211
log_init (argv[0]);
209212

0 commit comments

Comments
 (0)