summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Harris <peter.harris@hummingbird.com>2008-11-29 12:26:46 -0500
committerPeter Harris <peter.harris@hummingbird.com>2008-11-29 12:26:46 -0500
commitc9796f2f53a4ef16f5f5c8f3b7d01bc2ceb11547 (patch)
treec79eb667c3d66458f0b20e4f7b01962759563d18
parent0d1e2f9eaf0eca618db640733755f867b11b069c (diff)
Don't call exit() in xcb_aux_get_depth; return 0 instead.
-rw-r--r--aux/xcb_aux.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/aux/xcb_aux.c b/aux/xcb_aux.c
index cc96a62..1adc02a 100644
--- a/aux/xcb_aux.c
+++ b/aux/xcb_aux.c
@@ -44,18 +44,15 @@ xcb_aux_get_depth (xcb_connection_t *c,
{
xcb_drawable_t drawable;
xcb_get_geometry_reply_t *geom;
- int depth;
+ int depth = 0;
drawable = screen->root;
geom = xcb_get_geometry_reply (c, xcb_get_geometry(c, drawable), 0);
- if (!geom) {
- perror ("GetGeometry(root) failed");
- exit (0);
+ if (geom) {
+ depth = geom->depth;
+ free (geom);
}
-
- depth = geom->depth;
- free (geom);
return depth;
}