fuse Serve in goroutine

This commit is contained in:
Caleb Gardner
2022-12-17 17:06:28 -06:00
parent 4f8f5f6928
commit 820e06e792
+3 -1
View File
@@ -10,12 +10,14 @@ import (
"github.com/CalebQ42/squashfs/internal/inode"
)
// Creates a fuse mount, then mounts the archive on a seperate goroutine.
// If waiting for the mount to end, simply do <-con.Ready.
func (r *Reader) Mount(mountpoint string) (con *fuse.Conn, err error) {
con, err = fuse.Mount(mountpoint, fuse.ReadOnly())
if err != nil {
return
}
err = fs.Serve(con, &squashFuse{r: r})
go fs.Serve(con, &squashFuse{r: r})
return
}