aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/testdata/testprog/lockosthread.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/testdata/testprog/lockosthread.go')
-rw-r--r--src/runtime/testdata/testprog/lockosthread.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/runtime/testdata/testprog/lockosthread.go b/src/runtime/testdata/testprog/lockosthread.go
index 5119cf8131..fd3123e647 100644
--- a/src/runtime/testdata/testprog/lockosthread.go
+++ b/src/runtime/testdata/testprog/lockosthread.go
@@ -144,6 +144,10 @@ func LockOSThreadAvoidsStatePropagation() {
// the rest of the process on this thread.
// On systems other than Linux, this is a no-op.
if err := unshareFs(); err != nil {
+ if err == errNotPermitted {
+ println("unshare not permitted")
+ os.Exit(0)
+ }
println("failed to unshare fs:", err.Error())
os.Exit(1)
}