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

Chase Douglas chase.douglas at canonical.com
Mon Apr 16 11:14:23 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>
---
 include/os.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/include/os.h b/include/os.h
index 683679f..91d50c9 100644
--- a/include/os.h
+++ b/include/os.h
@@ -709,4 +709,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.1



More information about the xorg-devel mailing list