From aa2e4d92e0005f4516eb591803120eff89f99109 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 7 Aug 2014 18:54:06 +0200 Subject: fs/io/BufferedReader: new class to replace class TextFile The new class is pluggable, to prepare for gzipped database files. For now, the TextFile class remains, and will be refactored away later. --- src/db/plugins/simple/SimpleDatabasePlugin.cxx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/db') diff --git a/src/db/plugins/simple/SimpleDatabasePlugin.cxx b/src/db/plugins/simple/SimpleDatabasePlugin.cxx index ae34a523f..9e750996c 100644 --- a/src/db/plugins/simple/SimpleDatabasePlugin.cxx +++ b/src/db/plugins/simple/SimpleDatabasePlugin.cxx @@ -168,12 +168,9 @@ SimpleDatabase::Load(Error &error) assert(!path.IsNull()); assert(root != nullptr); - TextFile file(path); - if (file.HasFailed()) { - error.FormatErrno("Failed to open database file \"%s\"", - path_utf8.c_str()); + TextFile file(path, error); + if (file.HasFailed()) return false; - } if (!db_load_internal(file, *root, error)) return false; -- cgit v1.2.3