Commit ac20815d authored by Chase Douglas's avatar Chase Douglas Committed by Keith Packard
Browse files

Add ErrorFSigSafe() alternative to ErrorF()



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

[whot: edited to "ErrorFSigSafe"]
Signed-off-by: default avatarChase Douglas <chase.douglas@canonical.com>
Reviewed-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent 164b38c7
......@@ -656,6 +656,12 @@ extern _X_EXPORT void
ErrorF(const char *f, ...)
_X_ATTRIBUTE_PRINTF(1, 2);
extern _X_EXPORT void
VErrorFSigSafe(const char *f, va_list args)
_X_ATTRIBUTE_PRINTF(1, 0);
extern _X_EXPORT void
ErrorFSigSafe(const char *f, ...)
_X_ATTRIBUTE_PRINTF(1, 2);
extern _X_EXPORT void
LogPrintMarkers(void);
extern _X_EXPORT void
......
......@@ -779,6 +779,22 @@ ErrorF(const char *f, ...)
va_end(args);
}
void
VErrorFSigSafe(const char *f, va_list args)
{
LogVMessageVerbSigSafe(X_ERROR, -1, f, args);
}
void
ErrorFSigSafe(const char *f, ...)
{
va_list args;
va_start(args, f);
VErrorFSigSafe(f, args);
va_end(args);
}
void
LogPrintMarkers(void)
{
......
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