Make BUG_WARN* signal safe

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Chase Douglas 2012-04-16 09:47:42 -07:00 committed by Keith Packard
parent 0fa5217836
commit 512bec06be

View File

@ -371,10 +371,10 @@ extern _X_EXPORT unsigned long serverGeneration;
/* Don't use this directly, use BUG_WARN or BUG_WARN_MSG instead */ /* Don't use this directly, use BUG_WARN or BUG_WARN_MSG instead */
#define __BUG_WARN_MSG(cond, with_msg, ...) \ #define __BUG_WARN_MSG(cond, with_msg, ...) \
do { if (cond) { \ do { if (cond) { \
ErrorF("BUG: triggered 'if (" #cond ")'\n"); \ ErrorFSigSafe("BUG: triggered 'if (" #cond ")'\n"); \
ErrorF("BUG: %s:%d in %s()\n", \ ErrorFSigSafe("BUG: %s:%u in %s()\n", \
__FILE__, __LINE__, __func__); \ __FILE__, __LINE__, __func__); \
if (with_msg) ErrorF(__VA_ARGS__); \ if (with_msg) ErrorFSigSafe(__VA_ARGS__); \
xorg_backtrace(); \ xorg_backtrace(); \
} } while(0) } } while(0)