summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
authorChase Douglas <chase.douglas@canonical.com>2012-06-05 15:39:41 +1000
committerKeith Packard <keithp@keithp.com>2012-07-02 22:34:32 -0700
commitac20815d5235e7a8e7b331365aabf5a489fc5e34 (patch)
tree6f7c34f02fde566c788649dce876965a72e3b2d1 /os
parent164b38c72fe9c69d13ea4f9c46d4ccc46566d826 (diff)
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: 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>
Diffstat (limited to 'os')
-rw-r--r--os/log.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/os/log.c b/os/log.c
index f1a6e3bcd..47ba34876 100644
--- a/os/log.c
+++ b/os/log.c
@@ -780,6 +780,22 @@ ErrorF(const char *f, ...)
}
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)
{
/* Show what the message marker symbols mean. */