Commit c8185a54 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

fs: failure to unmount on cleanup is a fatal error

Any subsequent attempt to remove the mountdir will fail if the unmount
does not succeed.

Use syscall.Rmdir rather than os.Remove. We know the mount point is a
directory, and Go's cleverness can only complicate matters here.

Change-Id: I62cfad63f34af17b78c3184884a2972673f631a3
parent f50f7c4c
......@@ -34,9 +34,9 @@ func testMount(t *testing.T, root InodeEmbedder, opts *Options) (string, *fuse.S
}
return mntDir, server, func() {
if err := server.Unmount(); err != nil {
t.Errorf("testMount: Unmount failed: %v", err)
t.Fatalf("testMount: Unmount failed: %v", err)
}
if err := os.Remove(mntDir); err != nil {
if err := syscall.Rmdir(mntDir); err != nil {
t.Errorf("testMount: Remove failed: %v", err)
}
}
......
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