aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2023-03-15 10:41:38 +0100
committerEelco Dolstra <edolstra@gmail.com>2023-03-15 10:59:10 +0100
commit5eb8bfd0f17f950ec181d59fb9fbb2330f778935 (patch)
tree012542d5e74fade0bf157b287acdd15396676aff
parent6029c763c2c5998dc3265152425c8ff0ce01b1a0 (diff)
Remove a variable in LocalDerivationGoal
-rw-r--r--src/libstore/build/local-derivation-goal.cc8
-rw-r--r--src/libstore/build/local-derivation-goal.hh6
2 files changed, 5 insertions, 9 deletions
diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc
index f1ddf753f..538edef74 100644
--- a/src/libstore/build/local-derivation-goal.cc
+++ b/src/libstore/build/local-derivation-goal.cc
@@ -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))
@@ -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);
@@ -974,7 +974,7 @@ void LocalDerivationGoal::startBuilder()
#endif
{
pid = startProcess([&]() {
- runChild();
+ runChild(slaveName);
});
}
@@ -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! */
diff --git a/src/libstore/build/local-derivation-goal.hh b/src/libstore/build/local-derivation-goal.hh
index c3e8562ae..4d2f1ac28 100644
--- a/src/libstore/build/local-derivation-goal.hh
+++ b/src/libstore/build/local-derivation-goal.hh
@@ -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;
@@ -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. */