[Xcb-commit] aux

Peter Harris peterh at kemper.freedesktop.org
Sat Nov 29 09:33:11 PST 2008


 aux/xcb_aux.c |   11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

New commits:
commit c9796f2f53a4ef16f5f5c8f3b7d01bc2ceb11547
Author: Peter Harris <peter.harris at hummingbird.com>
Date:   Sat Nov 29 12:26:46 2008 -0500

    Don't call exit() in xcb_aux_get_depth; return 0 instead.

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;
 }


More information about the xcb-commit mailing list