aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/util.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/util.cc')
-rw-r--r--src/libutil/util.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc
index 1b6467eb2..43fea1b1e 100644
--- a/src/libutil/util.cc
+++ b/src/libutil/util.cc
@@ -1660,6 +1660,14 @@ void restoreMountNamespace()
#endif
}
+void unshareFilesystem()
+{
+#ifdef __linux__
+ if (unshare(CLONE_FS) != 0 && errno != EPERM)
+ throw SysError("unsharing filesystem state in download thread");
+#endif
+}
+
void restoreProcessContext(bool restoreMounts)
{
restoreSignals();