Browse Source

[3400] Coding style fixes, better error message.

Tomek Mrugalski 11 years ago
parent
commit
15b6012702
1 changed files with 5 additions and 4 deletions
  1. 5 4
      src/lib/cc/data.cc

+ 5 - 4
src/lib/cc/data.cc

@@ -619,7 +619,7 @@ Element::fromJSON(std::istream& in, bool preproc) throw(JSONError) {
         preprocess(in, filtered);
     }
 
-    ElementPtr value = fromJSON(preproc?filtered:in, "<istream>", line, pos);
+    ElementPtr value = fromJSON(preproc ? filtered : in, "<istream>", line, pos);
 
     return (value);
 }
@@ -633,7 +633,7 @@ Element::fromJSON(std::istream& in, const std::string& file_name, bool preproc)
     if (preproc) {
         preprocess(in, filtered);
     }
-    return (fromJSON(preproc?filtered:in, file_name, line, pos));
+    return (fromJSON(preproc ? filtered : in, file_name, line, pos));
 }
 
 ElementPtr
@@ -720,7 +720,7 @@ Element::fromJSON(const std::string& in, bool preproc) {
     if (preproc) {
         preprocess(ss, filtered);
     }
-    ElementPtr result(fromJSON(preproc?filtered:ss, "<string>", line, pos));
+    ElementPtr result(fromJSON(preproc ? filtered : ss, "<string>", line, pos));
     skipChars(ss, WHITESPACE, line, pos);
     // ss must now be at end
     if (ss.peek() != EOF) {
@@ -735,8 +735,9 @@ Element::fromJSONFile(const std::string& file_name,
     std::ifstream infile(file_name.c_str(), std::ios::in | std::ios::binary);
     if (!infile.is_open())
     {
+        const char* error = strerror(errno);
         isc_throw(InvalidOperation, "Failed to read file " << file_name
-                  << ",error:" << errno);
+                  << ",error:" << error);
     }
 
     return (fromJSON(infile, file_name, preproc));