From: Mikko Rasa Date: Thu, 7 Jun 2012 19:47:21 +0000 (+0300) Subject: Use stat to determine file existence X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=3bf5405f29937128bc945177d73ced3442f7b51d;p=builder.git Use stat to determine file existence --- diff --git a/source/dependencycache.cpp b/source/dependencycache.cpp index 8582e58..6e099ba 100644 --- a/source/dependencycache.cpp +++ b/source/dependencycache.cpp @@ -46,7 +46,7 @@ void DependencyCache::load() { string fn = (package.get_source()/".deps").str(); - try + if(FS::Stat st = FS::stat(fn)) { IO::BufferedFile in(fn); @@ -57,8 +57,6 @@ void DependencyCache::load() deps[parts[0]] = StringList(parts.begin()+1, parts.end()); } - mtime = FS::stat(fn).get_modify_time(); + mtime = st.get_modify_time(); } - catch(const IO::file_not_found &) - { } }