Navigation Menu

Skip to content

Commit

Permalink
Fix a bug that Storage::open_or_create() logs an error if missing.
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yata committed Jun 21, 2013
1 parent 74d70fc commit 7ac9b89
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/grnxx/storage/storage_impl.cpp
Expand Up @@ -512,7 +512,10 @@ bool StorageImpl::open_or_create_storage(const char *path, StorageFlags flags,
if (flags & STORAGE_HUGE_TLB) {
flags_ |= STORAGE_HUGE_TLB;
}
std::unique_ptr<File> header_file(File::open(path));
std::unique_ptr<File> header_file;
if (File::exists(path)) {
header_file.reset(File::open(path));
}
if (header_file) {
// Open an existing storage.
std::unique_ptr<Chunk> root_chunk(
Expand Down

0 comments on commit 7ac9b89

Please sign in to comment.