diff options
author | Jade Lovelace <lix@jade.fyi> | 2024-05-24 20:45:05 -0600 |
---|---|---|
committer | Jade Lovelace <lix@jade.fyi> | 2024-05-24 20:45:05 -0600 |
commit | 2a7a824d83dc5fb33326b8b89625685f283a743b (patch) | |
tree | c5a577ddfbf53bd4f86725702bfbb558ac6e92cc /src/libstore/daemon.cc | |
parent | 076c19e0d1a6ad226d002a359df666216fa97950 (diff) |
libstore: parse the buildMode instead of unchecked cast
Change-Id: Icf6af7935e8f139bef36b40ad475e973aa48855c
Diffstat (limited to 'src/libstore/daemon.cc')
-rw-r--r-- | src/libstore/daemon.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstore/daemon.cc b/src/libstore/daemon.cc index 242b4ddc6..420fc8bfe 100644 --- a/src/libstore/daemon.cc +++ b/src/libstore/daemon.cc @@ -527,7 +527,7 @@ static void performOp(TunnelLogger * logger, ref<Store> store, auto drvs = WorkerProto::Serialise<DerivedPaths>::read(*store, rconn); BuildMode mode = bmNormal; if (GET_PROTOCOL_MINOR(clientVersion) >= 15) { - mode = (BuildMode) readInt(from); + mode = buildModeFromInteger(readInt(from)); /* Repairing is not atomic, so disallowed for "untrusted" clients. @@ -551,7 +551,7 @@ static void performOp(TunnelLogger * logger, ref<Store> store, case WorkerProto::Op::BuildPathsWithResults: { auto drvs = WorkerProto::Serialise<DerivedPaths>::read(*store, rconn); BuildMode mode = bmNormal; - mode = (BuildMode) readInt(from); + mode = buildModeFromInteger(readInt(from)); /* Repairing is not atomic, so disallowed for "untrusted" clients. @@ -582,7 +582,7 @@ static void performOp(TunnelLogger * logger, ref<Store> store, * correctly. */ readDerivation(from, *store, drv, Derivation::nameFromPath(drvPath)); - BuildMode buildMode = (BuildMode) readInt(from); + BuildMode buildMode = buildModeFromInteger(readInt(from)); logger->startWork(); auto drvType = drv.type(); |