]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Improve error reporting in cf_gen.cc
authorFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 8 Aug 2011 19:12:16 +0000 (21:12 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 8 Aug 2011 19:12:16 +0000 (21:12 +0200)
src/cf_gen.cc

index 8834b0f0a2e8f7ca441c56c7f08bc2b466710495..306bb22db1c3ed96ff904a63f82193dd97ba7428 100644 (file)
@@ -202,7 +202,8 @@ main(int argc, char *argv[])
      *-------------------------------------------------------------------*/
     fp.open(type_depend, std::ifstream::in);
     if (fp.fail()) {
-        perror(input_filename);
+       std::cerr << "error while opening type dependencies file '" <<
+            input_filename << "': " << strerror(errno) << std::endl;
         exit(1);
     }
 
@@ -233,7 +234,8 @@ main(int argc, char *argv[])
 
     fp.open(input_filename, std::ifstream::in);
     if (fp.fail()) {
-        perror(input_filename);
+        std::cerr << "error while opening input file '" <<
+            input_filename << "': " << strerror(errno) << std::endl;
         exit(1);
     }
 
@@ -453,7 +455,8 @@ main(int argc, char *argv[])
 
     std::ofstream fout(output_filename,std::ostream::out);
     if (!fout.good()) {
-        perror(output_filename);
+        std::cerr << "error while opening output .c file '" <<
+            output_filename << "': " << strerror(errno) << std::endl;
         exit(1);
     }
 
@@ -483,7 +486,8 @@ main(int argc, char *argv[])
     /* Open output x.conf file */
     fout.open(conf_filename,std::ostream::out);
     if (!fout.good()) {
-        perror(conf_filename);
+        std::cerr << "error while opening output conf file '" <<
+            output_filename << "': " << strerror(errno) << std::endl;
         exit(1);
     }
 
@@ -493,7 +497,8 @@ main(int argc, char *argv[])
 
     fout.open(conf_filename_short,std::ostream::out);
     if (!fout.good()) {
-        perror(conf_filename_short);
+        std::cerr << "error while opening output short conf file '" <<
+            output_filename << "': " << strerror(errno) << std::endl;
         exit(1);
     }
     gen_conf(entries, fout, 0);