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
commit37214f5f8107d4244610a4761f4ea8d282b08562 (patch)
tree01a624f82ca89df80b7603066dc7ad896d741703
parentd2415a2866bddce14e3f948b08d6ba3f7dfceb3e (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;
}