diff options
author | Brian Paul <brianp@vmware.com> | 2011-03-17 20:31:58 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2011-03-17 20:31:58 -0600 |
commit | 582570a04c73bc304e16af63621b594e0fc39aea (patch) | |
tree | 676839143800db8d8e8b1f5854682440dea24022 /src/mesa/main/imports.c | |
parent | 147148fd50ec2db089a0fbcca9740146aa096be8 (diff) | |
download | external_mesa3d-582570a04c73bc304e16af63621b594e0fc39aea.zip external_mesa3d-582570a04c73bc304e16af63621b594e0fc39aea.tar.gz external_mesa3d-582570a04c73bc304e16af63621b594e0fc39aea.tar.bz2 |
mesa: only report up to 50 _mesa_problem() calls
http://bugs.freedesktop.org/show_bug.cgi?id=35200 reports a disk
partition getting filled because of warning messages. Stop emitting
after 50.
Diffstat (limited to 'src/mesa/main/imports.c')
-rw-r--r-- | src/mesa/main/imports.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index bf89815..f262b25 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -930,14 +930,20 @@ _mesa_problem( const struct gl_context *ctx, const char *fmtString, ... ) { va_list args; char str[MAXSTRING]; + static int numCalls = 0; + (void) ctx; - va_start( args, fmtString ); - vsnprintf( str, MAXSTRING, fmtString, args ); - va_end( args ); + if (numCalls < 50) { + numCalls++; - fprintf(stderr, "Mesa %s implementation error: %s\n", MESA_VERSION_STRING, str); - fprintf(stderr, "Please report at bugs.freedesktop.org\n"); + va_start( args, fmtString ); + vsnprintf( str, MAXSTRING, fmtString, args ); + va_end( args ); + fprintf(stderr, "Mesa %s implementation error: %s\n", + MESA_VERSION_STRING, str); + fprintf(stderr, "Please report at bugs.freedesktop.org\n"); + } } |