Skip to content

Commit 331eeca

Browse files
karenzsheaTheMarex
authored andcommitted
empty list of shmem regions if none found
1 parent f8d6e47 commit 331eeca

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

include/storage/shared_monitor.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,12 @@ template <typename Data> struct SharedMonitor
117117
#endif
118118

119119
static void remove() { bi::shared_memory_object::remove(Data::name); }
120-
static bool exists() {
120+
static bool exists()
121+
{
121122
try
122123
{
123-
bi::shared_memory_object shmem_open = bi::shared_memory_object(bi::open_only, Data::name, bi::read_only);
124+
bi::shared_memory_object shmem_open =
125+
bi::shared_memory_object(bi::open_only, Data::name, bi::read_only);
124126
}
125127
catch (const bi::interprocess_exception &exception)
126128
{

src/tools/store.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ void deleteRegion(const storage::SharedRegionRegister::ShmKey key)
2727

2828
void listRegions()
2929
{
30+
osrm::util::Log() << "name\tshm key\ttimestamp\tsize";
3031
if (!storage::SharedMonitor<storage::SharedRegionRegister>::exists())
3132
{
32-
osrm::util::Log() << "No shared memory regions found. Try running osrm-datastore";
3333
return;
3434
}
3535
storage::SharedMonitor<storage::SharedRegionRegister> monitor;

0 commit comments

Comments
 (0)