diff -up xdpyinfo-1.0.2/xdpyinfo.c.jx xdpyinfo-1.0.2/xdpyinfo.c
--- xdpyinfo-1.0.2/xdpyinfo.c.jx 2008-04-25 13:28:35.000000000 -0400
+++ xdpyinfo-1.0.2/xdpyinfo.c 2008-04-25 13:36:28.000000000 -0400
@@ -135,6 +135,14 @@ in this Software without prior written a
char *ProgramName;
Bool queryExtensions = False;
+static int
+silent_errors(Display *dpy, XErrorEvent *ev)
+{
+ return 0;
+}
+
+static int (*old_handler)(Display *, XErrorEvent *) = NULL;
+
static int print_event_mask(char *buf, int lastcol, int indent, long mask);
static int StrCmp(const void *a, const void *b)
@@ -730,12 +738,16 @@ print_dga_info(Display *dpy, char *extna
return 1;
}
+ old_handler = XSetErrorHandler(silent_errors);
+
if (!XF86DGAGetVideoLL(dpy, DefaultScreen(dpy), &offset,
&width, &bank, &ram))
return 0;
printf(" Base address = 0x%X, Width = %d, Bank size = %d,"
" RAM size = %dk\n", offset, width, bank, ram);
+ XSetErrorHandler(old_handler);
+
return 1;
}
#endif
@@ -846,24 +858,17 @@ char *flgtable[] = { "None", "ClearDTR",
"ClearDTR and ClearRTS" };
static int
-misc_error(Display *dpy, XErrorEvent *ev)
-{
- return 0;
-}
-
-static int
print_XF86Misc_info(Display *dpy, char *extname)
{
int majorrev, minorrev, ret = 1;
XF86MiscMouseSettings mouseinfo;
XF86MiscKbdSettings kbdinfo;
- int (*old_handler)(Display *, XErrorEvent *);
if (!XF86MiscQueryVersion(dpy, &majorrev, &minorrev))
return 0;
print_standard_extension_info(dpy, extname, majorrev, minorrev);
- old_handler = XSetErrorHandler(misc_error);
+ old_handler = XSetErrorHandler(silent_errors);
if ((majorrev > 0) || (majorrev == 0 && minorrev > 0)) do {
if (!XF86MiscGetKbdSettings(dpy, &kbdinfo)) {