]> Dogcows Code - chaz/openbox/commitdiff
watch for a failed opening of the X server!
authorDana Jansens <danakj@orodu.net>
Thu, 8 Aug 2002 18:21:01 +0000 (18:21 +0000)
committerDana Jansens <danakj@orodu.net>
Thu, 8 Aug 2002 18:21:01 +0000 (18:21 +0000)
util/xftlsfonts.cc

index 0651065bbd6096d6feaed4101d48fe3b347c3005..4f33737f168e66e59881ef807c3ece9253e477e0 100644 (file)
@@ -34,11 +34,15 @@ int main(int argc, char **argv) {
       }
 
   Display *display = XOpenDisplay(NULL);
+  if (! display) {
+    cout << "Failed to open connection to X display\n";
+    return 2;
+  }
 
   XftObjectSet *obj = XftObjectSetCreate();
   if (! obj) {
     cout << "Failed to create an XftObjectSet\n";
-    exit(2);
+    return 2;
   }
 
   XftObjectSetAdd(obj, XFT_FAMILY);
This page took 0.021595 seconds and 4 git commands to generate.