Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Thanks!

Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
  • Loading branch information
Ericson2314 and edolstra authored Jan 22, 2021
1 parent 7af7434 commit 7eab7b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/build-remote/build-remote.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ static int main_build_remote(int argc, char * * argv)

/* It would be more appropriate to use $XDG_RUNTIME_DIR, since
that gets cleared on reboot, but it wouldn't work on macOS. */
currentLoad = "/current-load";
auto currentLoadName = "/current-load";
if (auto localStore = store.dynamic_pointer_cast<LocalFSStore>())
currentLoad = std::string { localStore->stateDir } + currentLoad;
currentLoad = std::string { localStore->stateDir } + currentLoadName;
else
currentLoad = settings.nixStateDir + currentLoad;
currentLoad = settings.nixStateDir + currentLoadName;

std::shared_ptr<Store> sshStore;
AutoCloseFD bestSlotLock;
Expand Down
4 changes: 2 additions & 2 deletions src/libstore/build/derivation-goal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3291,7 +3291,7 @@ void DerivationGoal::registerOutputs()

auto localStoreP = dynamic_cast<LocalStore *>(&worker.store);
if (!localStoreP)
Unsupported("Can only register outputs with local store");
throw Unsupported("can only register outputs with local store");
auto & localStore = *localStoreP;

if (buildMode == bmCheck) {
Expand Down Expand Up @@ -3426,7 +3426,7 @@ void DerivationGoal::registerOutputs()
{
auto localStoreP = dynamic_cast<LocalStore *>(&worker.store);
if (!localStoreP)
Unsupported("Can only register outputs with local store");
throw Unsupported("can only register outputs with local store");
auto & localStore = *localStoreP;

ValidPathInfos infos2;
Expand Down

0 comments on commit 7eab7b9

Please sign in to comment.