X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=bin%2Foverride.c;h=60bee0ce3eebfa21a527a5359bbc9a82da79f087;hb=f0d55dabe9747009d296e251bda7dc2f812bb077;hp=964bc21d8794fce1db8eebe80ee58330ad885685;hpb=389dcfadc1a417abe9f5d9a07ac7c7ad524562ea;p=vlc diff --git a/bin/override.c b/bin/override.c index 964bc21d87..60bee0ce3e 100644 --- a/bin/override.c +++ b/bin/override.c @@ -196,6 +196,24 @@ int sigaction (int signum, const struct sigaction *act, struct sigaction *old) } +/*** Locales *** + * setlocale() is not thread-safe and has a tendency to crash other threads as + * quite many libc and libintl calls depend on the locale. + * Use uselocale() instead for thread-safety. + */ +#include + +char *setlocale (int cat, const char *locale) +{ + if (override && locale != NULL) + { + LOG("Blocked", "%d, \"%s\"", cat, locale); + return NULL; + } + return CALL(setlocale, cat, locale); +} + + /*** Xlib ****/ #ifdef HAVE_X11_XLIB_H # include