aboutsummaryrefslogtreecommitdiff
path: root/src/nix-worker/main.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix-worker/main.cc')
-rw-r--r--src/nix-worker/main.cc17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/nix-worker/main.cc b/src/nix-worker/main.cc
index 3642697dc..6d6571536 100644
--- a/src/nix-worker/main.cc
+++ b/src/nix-worker/main.cc
@@ -79,25 +79,18 @@ void processConnection(Source & from, Sink & to)
break;
}
- case wopAddToStore:
- case wopAddToStoreFixed: {
+ case wopAddToStore: {
/* !!! uberquick hack */
string baseName = readString(from);
- bool recursive = false;
- string hashAlgo;
- if (op == wopAddToStoreFixed) {
- recursive = readInt(from) == 1;
- hashAlgo = readString(from);
- }
+ bool fixed = readInt(from) == 1;
+ bool recursive = readInt(from) == 1;
+ string hashAlgo = readString(from);
Path tmp = createTempDir();
Path tmp2 = tmp + "/" + baseName;
restorePath(tmp2, from);
- if (op == wopAddToStoreFixed)
- writeString(store->addToStoreFixed(recursive, hashAlgo, tmp2), to);
- else
- writeString(store->addToStore(tmp2), to);
+ writeString(store->addToStore(tmp2, fixed, recursive, hashAlgo), to);
deletePath(tmp);
break;