about summary refs log tree commit diff
path: root/src/libutil/util.cc
diff options
context:
space:
mode:
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 6e4536e6e4ea..e12c4b258c25 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 {