aboutsummaryrefslogtreecommitdiff
path: root/src/os/root_unix.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/os/root_unix.go')
-rw-r--r--src/os/root_unix.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/os/root_unix.go b/src/os/root_unix.go
index ed21afffb5..4d6fc19a08 100644
--- a/src/os/root_unix.go
+++ b/src/os/root_unix.go
@@ -56,7 +56,7 @@ func newRoot(fd int, name string) (*Root, error) {
fd: fd,
name: name,
}}
- r.root.cleanup = runtime.AddCleanup(r, func(f *root) { f.Close() }, r.root)
+ runtime.SetFinalizer(r.root, (*root).Close)
return r, nil
}