aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/util.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2018-11-15 12:59:54 +0100
committerEelco Dolstra <edolstra@gmail.com>2018-11-15 13:20:39 +0100
commita32ff2573ba4d0df4e3360c5a96398738da953f6 (patch)
tree831ef2cb312018a77abc42a9e701eae93914f526 /src/libutil/util.cc
parent32a0a223d589085ad43d77f4f36266a74e2822a8 (diff)
Fix 'Read-only file system' when building a derivation
Diffstat (limited to 'src/libutil/util.cc')
-rw-r--r--src/libutil/util.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc
index 6e4536e6e..e12c4b258 100644
--- a/src/libutil/util.cc
+++ b/src/libutil/util.cc
@@ -936,7 +936,8 @@ pid_t startProcess(std::function<void()> fun, const ProcessOptions & options)
throw SysError("setting death signal");
#endif
restoreAffinity();
- restoreMountNamespace();
+ if (options.restoreMountNamespace)
+ restoreMountNamespace();
fun();
} catch (std::exception & e) {
try {