summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaulo Ricardo Zanoni <pzanoni@mandriva.com>2010-03-11 14:28:18 -0300
committerPeter Hutterer <peter.hutterer@who-t.net>2010-04-09 09:47:01 +1000
commitff5af4dc2d14c1bf2676f69e7dcee62eb9a08f78 (patch)
tree763e93e4c2ff2b5cfea760ee91984c91bbb84db4
parent2350035463bcfb6d80249b55ce392a154a8d91da (diff)
dix: be more verbose when we run out of opcodes
If we run out of opcodes, nothing is print on the log, making the problem hard to debug. In the current Xserver, if you enable some extensions like multibuffer (+2 events) and use nvidia binary driver (+5 events) you can run out of opcode numbers. Signed-off-by: Paulo Ricardo Zanoni <pzanoni@mandriva.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Keith Packard <keithp@keithp.com> (cherry picked from commit a9fe7cfa77ccee64d68732dc3f37d35cbfc27a65) Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--dix/extension.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/dix/extension.c b/dix/extension.c
index fb83af148..f34866586 100644
--- a/dix/extension.c
+++ b/dix/extension.c
@@ -83,8 +83,11 @@ AddExtension(char *name, int NumEvents, int NumErrors,
if (!MainProc || !SwappedMainProc || !MinorOpcodeProc)
return((ExtensionEntry *) NULL);
if ((lastEvent + NumEvents > LAST_EVENT) ||
- (unsigned)(lastError + NumErrors > LAST_ERROR))
+ (unsigned)(lastError + NumErrors > LAST_ERROR)) {
+ LogMessage(X_ERROR, "Not enabling extension %s: maximum number of "
+ "events or errors exceeded.\n", name);
return((ExtensionEntry *) NULL);
+ }
ext = xalloc(sizeof(ExtensionEntry));
if (!ext)