From ec1a84c57a07d57371586f215ea6e9e6f1d38102 Mon Sep 17 00:00:00 2001 From: Patrick Niklaus Date: Wed, 23 Mar 2016 22:18:11 +0100 Subject: [PATCH] Always safe the absolute path to .fileIndex --- src/storage/storage.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/storage/storage.cpp b/src/storage/storage.cpp index 6eac15e47..862ca3c7d 100644 --- a/src/storage/storage.cpp +++ b/src/storage/storage.cpp @@ -124,9 +124,10 @@ int Storage::Run() // Allocate a memory layout in shared memory, deallocate previous auto *layout_memory = makeSharedMemory(layout_region, sizeof(SharedDataLayout)); auto shared_layout_ptr = new (layout_memory->Ptr()) SharedDataLayout(); + auto absolute_file_index_path = boost::filesystem::absolute(config.file_index_path); shared_layout_ptr->SetBlockSize(SharedDataLayout::FILE_INDEX_PATH, - config.file_index_path.string().length() + 1); + absolute_file_index_path.string().length() + 1); // collect number of elements to store in shared memory object util::SimpleLogger().Write() << "load names from: " << config.names_data_path; @@ -329,7 +330,7 @@ int Storage::Run() file_index_path_ptr + shared_layout_ptr->GetBlockSize(SharedDataLayout::FILE_INDEX_PATH), 0); - std::copy(config.file_index_path.string().begin(), config.file_index_path.string().end(), file_index_path_ptr); + std::copy(absolute_file_index_path.string().begin(), absolute_file_index_path.string().end(), file_index_path_ptr); // Loading street names unsigned *name_offsets_ptr = shared_layout_ptr->GetBlockPtr(