about summary refs log tree commit diff
path: root/src/libstore/store-api.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/store-api.cc')
-rw-r--r--src/libstore/store-api.cc13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc
index f5035d3230fd..98399cc485f2 100644
--- a/src/libstore/store-api.cc
+++ b/src/libstore/store-api.cc
@@ -284,12 +284,12 @@ string showPaths(const PathSet & paths)
 }
 
 
-void exportPaths(StoreAPI & store, const Paths & paths,
+void StoreAPI::exportPaths(const Paths & paths,
     bool sign, Sink & sink)
 {
     for (auto & i : paths) {
         sink << 1;
-        store.exportPath(i, sign, sink);
+        exportPath(i, sign, sink);
     }
     sink << 0;
 }
@@ -306,10 +306,7 @@ void exportPaths(StoreAPI & store, const Paths & paths,
 namespace nix {
 
 
-std::shared_ptr<StoreAPI> store;
-
-
-std::shared_ptr<StoreAPI> openStore(bool reserveSpace)
+ref<StoreAPI> openStore(bool reserveSpace)
 {
     enum { mDaemon, mLocal, mAuto } mode;
 
@@ -325,8 +322,8 @@ std::shared_ptr<StoreAPI> openStore(bool reserveSpace)
     }
 
     return mode == mDaemon
-        ? (std::shared_ptr<StoreAPI>) std::make_shared<RemoteStore>()
-        : std::make_shared<LocalStore>(reserveSpace);
+        ? make_ref<StoreAPI, RemoteStore>()
+        : make_ref<StoreAPI, LocalStore>(reserveSpace);
 }