[PATCH] Warn when the cache file failed to open

Faidon Liambotis paravoid at debian.org
Mon Jul 6 02:55:20 UTC 2009


Running rtconfig -f filename-with-a-typo can lead to confusion when no
errors appear and the relevant entries are fetched from the public
WHOIS.

Warn the user when we were unable to open the file, e.g. because it
didn't exist.
---
 src/irr/irr.cc |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/irr/irr.cc b/src/irr/irr.cc
index 7985dba..5075191 100644
--- a/src/irr/irr.cc
+++ b/src/irr/irr.cc
@@ -236,8 +236,10 @@ void IRR::initCache(const char *fname) {
       return;
 
    ifstream in(fname);
-   if (!in)
+   if (!in) {
+      cerr << "WARNING: Could not open '" << fname << "' for reading" << endl;
       return;
+   }
 
    bool code = true;
    char *objectText;
-- 
1.5.6.5




More information about the irrtoolset mailing list