diff options
author | Max Kellermann <max@duempel.org> | 2014-02-09 07:44:07 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-02-09 11:07:08 +0100 |
commit | a9fefcf6008cd6dbefdd5bd1b3a49e093ae9dcf5 (patch) | |
tree | 48d05a139b59f9e86d78e31170e92072f45564d4 /src/Main.cxx | |
parent | 59ce67e2e55098c8cbe1707e8a32900128345315 (diff) | |
download | mpd-a9fefcf6008cd6dbefdd5bd1b3a49e093ae9dcf5.tar.gz mpd-a9fefcf6008cd6dbefdd5bd1b3a49e093ae9dcf5.tar.xz mpd-a9fefcf6008cd6dbefdd5bd1b3a49e093ae9dcf5.zip |
Main: wrap the Storage instance in CompositeStorage
Diffstat (limited to 'src/Main.cxx')
-rw-r--r-- | src/Main.cxx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/Main.cxx b/src/Main.cxx index 3a40f0bb0..edd670763 100644 --- a/src/Main.cxx +++ b/src/Main.cxx @@ -71,6 +71,7 @@ #include "db/DatabaseSimple.hxx" #include "db/plugins/SimpleDatabasePlugin.hxx" #include "storage/Configured.hxx" +#include "storage/CompositeStorage.hxx" #endif #ifdef ENABLE_NEIGHBOR_PLUGINS @@ -148,8 +149,16 @@ glue_mapper_init(Error &error) static bool InitStorage(Error &error) { - instance->storage = CreateConfiguredStorage(error); - return !error.IsDefined(); + Storage *storage = CreateConfiguredStorage(error); + if (storage == nullptr) + return !error.IsDefined(); + + assert(!error.IsDefined()); + + CompositeStorage *composite = new CompositeStorage(); + instance->storage = composite; + composite->Mount("", storage); + return true; } /** |