[PATCH v4 06/16] Add ErrorSigSafe() alternative to ErrorF()

Chase Douglas chase.douglas at canonical.com
Mon May 14 14:14:27 PDT 2012


ErrorF() is not signal safe. Use ErrorSigSafe() whenever an error
message may be logged in signal context.

Signed-off-by: Chase Douglas <chase.douglas at canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 include/os.h |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/os.h b/include/os.h
index 8e7aedb..ba0c627 100644
--- a/include/os.h
+++ b/include/os.h
@@ -708,4 +708,7 @@ _Pragma("GCC diagnostic pop") \
     _LogMessageVerbSigSafe(type, verb, fmt, _args, _num_args); \
 } while(0)
 
+#define ErrorSigSafe(fmt, ...) \
+    LogMessageVerbSigSafe(X_NONE, -1, fmt, __VA_ARGS__)
+
 #endif                          /* OS_H */
-- 
1.7.9.5



More information about the xorg-devel mailing list