From 6a90b0c6290de7049ae5ed7c695ace0e45fda1c5 Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Mon, 23 Jan 2017 14:39:52 +0200 Subject: [PATCH] Ok to continue even if storage directory is created at startup Due to some refactoring that possibility had been lost. --- .../filter/cache/storage/storage_rocksdb/rocksdbstorage.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/modules/filter/cache/storage/storage_rocksdb/rocksdbstorage.cc b/server/modules/filter/cache/storage/storage_rocksdb/rocksdbstorage.cc index dd1ef15b1..122bbcca2 100644 --- a/server/modules/filter/cache/storage/storage_rocksdb/rocksdbstorage.cc +++ b/server/modules/filter/cache/storage/storage_rocksdb/rocksdbstorage.cc @@ -288,6 +288,8 @@ RocksDBStorage* RocksDBStorage::Create(const char* zName, { unique_ptr sStorage; + bool ok = true; + if (mkdir(storageDirectory.c_str(), S_IRWXU) == 0) { MXS_NOTICE("Created storage directory %s.", storageDirectory.c_str()); @@ -298,8 +300,10 @@ RocksDBStorage* RocksDBStorage::Create(const char* zName, MXS_ERROR("Failed to create storage directory %s: %s", storageDirectory.c_str(), strerror_r(errno, errbuf, sizeof(errbuf))); + ok = false; } - else + + if (ok) { string path(storageDirectory + "/" + zName);