Commit ac3dcb75 authored by Adam H. Leventhal's avatar Adam H. Leventhal

fix spurious failures due to unexpected mountFd closure

parent 547ec86c
......@@ -61,7 +61,10 @@ func mount(mountPoint string, opts *MountOptions, ready chan<- error) (fd int, e
ready <- err
close(ready)
}()
return int(f.Fd()), nil
// The finalizer for f will close its fd so we return a dup.
defer f.Close()
return syscall.Dup(int(f.Fd()))
}
func unmount(dir string) error {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment