From c297d134c33cf0dbf02cafe8966b4ebdc3329d7a Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Tue, 12 Jul 2005 20:54:15 +0000 Subject: [PATCH] Log an error when a file opening failed. --- src/filesystem.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/filesystem.cpp b/src/filesystem.cpp index 05a85bb38da..9582a4aaae4 100644 --- a/src/filesystem.cpp +++ b/src/filesystem.cpp @@ -440,7 +440,10 @@ std::istream *istream_file(std::string const &fname) // FIXME: why do we rely on this even with relative paths ? // still useful with zipios, for things like cache and prefs - return new std::ifstream(fname.c_str(),std::ios_base::binary); + std::istream *s = new std::ifstream(fname.c_str(), std::ios_base::binary); + if (s->fail()) + ERR_FS << "streaming " << fname << " failed.\n"; + return s; } std::string read_file(std::string const &fname)