]> git.mxchange.org Git - simgear.git/blobdiff - simgear/io/sg_binobj.cxx
Make tsync part of libSimGearCore when building shared libraries
[simgear.git] / simgear / io / sg_binobj.cxx
index 54f3b8debf5c3d7ec00f13b93f6e14b5b7f3874b..f511164064fc5f0d3bafb39ce71e548baa50da3a 100644 (file)
@@ -461,7 +461,7 @@ bool SGBinObject::read_bin( const string& file ) {
      //cout << "Total objects to read = " << nobjects << endl;
 
     if ( sgReadError() ) {
-        cout << "We detected an error while reading the file header" << endl;
+        cout << "Error while reading header of file " << file << "(.gz)" << endl;
         return false;
     }
     
@@ -612,7 +612,7 @@ bool SGBinObject::read_bin( const string& file ) {
         }
         
         if ( sgReadError() ) {
-            cout << "We detected an error while reading object:" << i << endl;
+            cout << "Error while reading object:" << i << " in file " << file << "(.gz)" << endl;
             return false;
         }
     }
@@ -621,7 +621,7 @@ bool SGBinObject::read_bin( const string& file ) {
     gzclose(fp);
 
     if ( sgReadError() ) {
-        cout << "We detected an error while reading the file." << endl;
+        cout << "Error while reading file " << file << "(.gz)" << endl;
         return false;
     }
 
@@ -829,7 +829,7 @@ bool SGBinObject::write_bin_file(const SGPath& file)
     gzclose(fp);
 
     if ( sgWriteError() ) {
-        cout << "We detected an error while writing the file." << endl;
+        cout << "Error while writing file " << file.str() << endl;
         return false;
     }
 
@@ -1006,9 +1006,13 @@ bool SGBinObject::write_ascii( const string& base, const string& name,
     fclose(fp);
 
     string command = "gzip --force --best " + file.str();
-    system(command.c_str());
+    int err = system(command.c_str());
+    if (err)
+    {
+        cout << "ERROR: gzip " << file.str() << " failed!" << endl;
+    }
 
-    return true;
+    return (err == 0);
 }
 
 void SGBinObject::read_properties(gzFile fp, int nproperties)