empty list of shmem regions if none found
This commit is contained in:
parent
730d2b5ef2
commit
e3b831364f
@ -117,10 +117,12 @@ template <typename Data> struct SharedMonitor
|
||||
#endif
|
||||
|
||||
static void remove() { bi::shared_memory_object::remove(Data::name); }
|
||||
static bool exists() {
|
||||
static bool exists()
|
||||
{
|
||||
try
|
||||
{
|
||||
bi::shared_memory_object shmem_open = bi::shared_memory_object(bi::open_only, Data::name, bi::read_only);
|
||||
bi::shared_memory_object shmem_open =
|
||||
bi::shared_memory_object(bi::open_only, Data::name, bi::read_only);
|
||||
}
|
||||
catch (const bi::interprocess_exception &exception)
|
||||
{
|
||||
|
@ -27,9 +27,9 @@ void deleteRegion(const storage::SharedRegionRegister::ShmKey key)
|
||||
|
||||
void listRegions()
|
||||
{
|
||||
osrm::util::Log() << "name\tshm key\ttimestamp\tsize";
|
||||
if (!storage::SharedMonitor<storage::SharedRegionRegister>::exists())
|
||||
{
|
||||
osrm::util::Log() << "No shared memory regions found. Try running osrm-datastore";
|
||||
return;
|
||||
}
|
||||
storage::SharedMonitor<storage::SharedRegionRegister> monitor;
|
||||
|
Loading…
Reference in New Issue
Block a user