Skip to content

Commit

Permalink
Remove a variable in LocalDerivationGoal
Browse files Browse the repository at this point in the history
  • Loading branch information
edolstra committed Mar 15, 2023
1 parent 6029c76 commit 5eb8bfd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/libstore/build/local-derivation-goal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ void LocalDerivationGoal::startBuilder()
throw SysError("opening pseudoterminal master");

// FIXME: not thread-safe, use ptsname_r
slaveName = ptsname(builderOut.get());
std::string slaveName = ptsname(builderOut.get());

if (buildUser) {
if (chmod(slaveName.c_str(), 0600))
Expand Down Expand Up @@ -898,7 +898,7 @@ void LocalDerivationGoal::startBuilder()
if (usingUserNamespace)
options.cloneFlags |= CLONE_NEWUSER;

pid_t child = startProcess([&]() { runChild(); }, options);
pid_t child = startProcess([&]() { runChild(slaveName); }, options);

writeFull(sendPid.writeSide.get(), fmt("%d\n", child));
_exit(0);
Expand Down Expand Up @@ -974,7 +974,7 @@ void LocalDerivationGoal::startBuilder()
#endif
{
pid = startProcess([&]() {
runChild();
runChild(slaveName);
});
}

Expand Down Expand Up @@ -1620,7 +1620,7 @@ void setupSeccomp()
}


void LocalDerivationGoal::runChild()
void LocalDerivationGoal::runChild(const Path & slaveName)
{
/* Warning: in the child we should absolutely not make any SQLite
calls! */
Expand Down
6 changes: 1 addition & 5 deletions src/libstore/build/local-derivation-goal.hh
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ struct LocalDerivationGoal : public DerivationGoal
standard output/error. */
AutoCloseFD builderOut;

/* Slave side of the pseudoterminal used for the builder's
standard output/error. */
Path slaveName;

/* Pipe for synchronising updates to the builder namespaces. */
Pipe userNamespaceSync;

Expand Down Expand Up @@ -173,7 +169,7 @@ struct LocalDerivationGoal : public DerivationGoal
int getChildStatus() override;

/* Run the builder's process. */
void runChild();
void runChild(const std::string & slaveName);

/* Check that the derivation outputs all exist and register them
as valid. */
Expand Down

0 comments on commit 5eb8bfd

Please sign in to comment.