aboutsummaryrefslogtreecommitdiffstats
path: root/xcompmgr.c
diff options
context:
space:
mode:
authorYann Droneaud <ydroneaud@mandriva.com>2009-03-26 12:05:30 +0100
committerAdam Jackson <ajax@redhat.com>2009-04-14 10:22:01 -0400
commita78f73b0d01374089ca7fcd838b647f6cfd1663a (patch)
tree8f984547d4753994e8481c1b31a5b755b0e2444f /xcompmgr.c
parentAnsification and compile warning fixes. (diff)
downloadxcman-a78f73b0d01374089ca7fcd838b647f6cfd1663a.tar.gz
xcman-a78f73b0d01374089ca7fcd838b647f6cfd1663a.tar.bz2
xcman-a78f73b0d01374089ca7fcd838b647f6cfd1663a.tar.xz
Fix error reporting
Use the 'name' looked up for extension errors If 'name' is NULL, use XGetErrorText(). Report error on stderr.
Diffstat (limited to '')
-rw-r--r--xcompmgr.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/xcompmgr.c b/xcompmgr.c
index 5a38cf1..526c9b8 100644
--- a/xcompmgr.c
+++ b/xcompmgr.c
@@ -1742,6 +1742,7 @@ error (Display *dpy, XErrorEvent *ev)
{
int o;
const char *name = NULL;
+ static char buffer[256];
if (should_ignore (dpy, ev->serial))
return 0;
@@ -1772,9 +1773,17 @@ error (Display *dpy, XErrorEvent *ev)
case BadGlyph: name ="BadGlyph"; break;
default: break;
}
-
- printf ("error %d request %d minor %d serial %lu\n",
- ev->error_code, ev->request_code, ev->minor_code, ev->serial);
+
+ if (name == NULL)
+ {
+ buffer[0] = '\0';
+ XGetErrorText (dpy, ev->error_code, buffer, sizeof (buffer));
+ name = buffer;
+ }
+
+ fprintf (stderr, "error %d: %s request %d minor %d serial %lu\n",
+ ev->error_code, (strlen (name) > 0) ? name : "unknown",
+ ev->request_code, ev->minor_code, ev->serial);
/* abort (); this is just annoying to most people */
return 0;