diff options
author | marha <marha@users.sourceforge.net> | 2012-08-28 14:07:02 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-09-04 14:23:04 +0200 |
commit | 9dec848b23cf905ded387820f2893425cc00d545 (patch) | |
tree | 4933836d801d8569a31cd5689e5f8eceeb4f78ff /xorg-server/os | |
parent | 9891a8cd45663a5431bbae63ccc41c6570a60d5b (diff) | |
download | vcxsrv-9dec848b23cf905ded387820f2893425cc00d545.tar.gz vcxsrv-9dec848b23cf905ded387820f2893425cc00d545.tar.bz2 vcxsrv-9dec848b23cf905ded387820f2893425cc00d545.zip |
fontconfig mesa xserver git update 28 Aug 2012
Diffstat (limited to 'xorg-server/os')
-rw-r--r-- | xorg-server/os/log.c | 48 | ||||
-rw-r--r-- | xorg-server/os/utils.c | 14 |
2 files changed, 48 insertions, 14 deletions
diff --git a/xorg-server/os/log.c b/xorg-server/os/log.c index de7aaade7..9c83175c5 100644 --- a/xorg-server/os/log.c +++ b/xorg-server/os/log.c @@ -296,6 +296,7 @@ pnprintf(char *string, size_t size, const char *f, va_list args) int p_len; int i; uint64_t ui; + int64_t si; for (; f_idx < f_len && s_idx < size - 1; f_idx++) { if (f[f_idx] != '%') { @@ -320,6 +321,15 @@ pnprintf(char *string, size_t size, const char *f, va_list args) for (i = 0; i < p_len && s_idx < size - 1; i++) string[s_idx++] = number[i]; break; + case 'i': + case 'd': + si = va_arg(args, int); + FormatInt64(si, number); + p_len = strlen_sigsafe(number); + + for (i = 0; i < p_len && s_idx < size - 1; i++) + string[s_idx++] = number[i]; + break; case 'p': string[s_idx++] = '0'; @@ -463,6 +473,7 @@ LogMessageTypeVerbString(MessageType type, int verb) void LogVMessageVerb(MessageType type, int verb, const char *format, va_list args) { + static unsigned int warned; const char *type_str; char buf[1024]; const size_t size = sizeof(buf); @@ -470,13 +481,17 @@ LogVMessageVerb(MessageType type, int verb, const char *format, va_list args) size_t len = 0; if (inSignalContext) { - BUG_WARN_MSG(inSignalContext, - "Warning: attempting to log data in a signal unsafe " - "manner while in signal context. Please update to check " - "inSignalContext and/or use LogMessageVerbSigSafe() or " - "ErrorFSigSafe(). The offending log format message is:\n" - "%s\n", format); - return; + if (warned < 3) { + BUG_WARN_MSG(inSignalContext, + "Warning: attempting to log data in a signal unsafe " + "manner while in signal context.\nPlease update to check " + "inSignalContext and/or use LogMessageVerbSigSafe() or " + "ErrorFSigSafe().\nThe offending log format message is:\n" + "%s\n", format); + warned++; + if (warned == 3) + LogMessageVerbSigSafe(X_WARNING, -1, "Warned %u times about sigsafe logging. Will be quiet now.\n", warned); + } } type_str = LogMessageTypeVerbString(type, verb); @@ -562,6 +577,7 @@ void LogVHdrMessageVerb(MessageType type, int verb, const char *msg_format, va_list msg_args, const char *hdr_format, va_list hdr_args) { + static unsigned int warned; const char *type_str; char buf[1024]; const size_t size = sizeof(buf); @@ -569,13 +585,17 @@ LogVHdrMessageVerb(MessageType type, int verb, const char *msg_format, size_t len = 0; if (inSignalContext) { - BUG_WARN_MSG(inSignalContext, - "Warning: attempting to log data in a signal unsafe " - "manner while in signal context. Please update to check " - "inSignalContext and/or use LogMessageVerbSigSafe(). The " - "offending header and log message formats are:\n%s %s\n", - hdr_format, msg_format); - return; + if (warned < 3) { + BUG_WARN_MSG(inSignalContext, + "Warning: attempting to log data in a signal unsafe " + "manner while in signal context.\nPlease update to check " + "inSignalContext and/or use LogMessageVerbSigSafe().\nThe " + "offending header and log message formats are:\n%s %s\n", + hdr_format, msg_format); + warned++; + if (warned == 3) + LogMessageVerbSigSafe(X_WARNING, -1, "Warned %u times about sigsafe logging. Will be quiet now.\n", warned); + } } type_str = LogMessageTypeVerbString(type, verb); diff --git a/xorg-server/os/utils.c b/xorg-server/os/utils.c index 3e3d97011..43842c067 100644 --- a/xorg-server/os/utils.c +++ b/xorg-server/os/utils.c @@ -1987,6 +1987,20 @@ xstrtokenize(const char *str, const char *separators) return NULL; } +/* Format a signed number into a string in a signal safe manner. The string + * should be at least 21 characters in order to handle all int64_t values. + */ +void +FormatInt64(int64_t num, char *string) +{ + if (num < 0) { + string[0] = '-'; + num *= -1; + string++; + } + FormatUInt64(num, string); +} + /* Format a number into a string in a signal safe manner. The string should be * at least 21 characters in order to handle all uint64_t values. */ void |