Commit f0d55dab authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Block setlocale()

This has already caused some problems (e.g. live555)
parent 389dcfad
...@@ -196,6 +196,24 @@ int sigaction (int signum, const struct sigaction *act, struct sigaction *old) ...@@ -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 <locale.h>
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 ****/ /*** Xlib ****/
#ifdef HAVE_X11_XLIB_H #ifdef HAVE_X11_XLIB_H
# include <X11/Xlib.h> # include <X11/Xlib.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment