aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/util.hh
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2021-04-07 12:21:31 +0200
committerEelco Dolstra <edolstra@gmail.com>2021-04-07 12:21:31 +0200
commit8a29052cb2f52ef2c82c36fb3818fd0f66349729 (patch)
treebbd3b3c11f2876efa14b34e40e1451050c3dce73 /src/libutil/util.hh
parent4bf3eb27e6e2c0cdac862d188b23342793180999 (diff)
PathSubstitutionGoal: Clean up pipe
If there were many top-level goals (which are not destroyed until the very end), commands like $ nix copy --to 'ssh://localhost?remote-store=/tmp/nix' \ /run/current-system --no-check-sigs --substitute-on-destination could fail with "Too many open files". So now we do some explicit cleanup from amDone(). It would be cleaner to separate goals from their temporary internal state, but that would be a bigger refactor.
Diffstat (limited to 'src/libutil/util.hh')
-rw-r--r--src/libutil/util.hh3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libutil/util.hh b/src/libutil/util.hh
index ad49c65b3..ef5e5012b 100644
--- a/src/libutil/util.hh
+++ b/src/libutil/util.hh
@@ -188,7 +188,6 @@ public:
class AutoCloseFD
{
int fd;
- void close();
public:
AutoCloseFD();
AutoCloseFD(int fd);
@@ -200,6 +199,7 @@ public:
int get() const;
explicit operator bool() const;
int release();
+ void close();
};
@@ -216,6 +216,7 @@ class Pipe
public:
AutoCloseFD readSide, writeSide;
void create();
+ void close();
};