Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion mount_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ func isBoringFusermountError(err error) bool {
return false
}

func fusermountBinary() string {
if path, err := exec.LookPath("fusermount3"); err == nil {
return path
}
return "fusermount"
}

func mount(
dir string,
conf *mountConfig,
Expand All @@ -77,7 +84,7 @@ func mount(
defer readFile.Close()

cmd := exec.Command(
"fusermount",
fusermountBinary(),
"-o", conf.getOptions(),
"--",
dir,
Expand Down
2 changes: 1 addition & 1 deletion unmount_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

func unmount(dir string) error {
cmd := exec.Command("fusermount", "-u", dir)
cmd := exec.Command(fusermountBinary(), "-u", dir)
output, err := cmd.CombinedOutput()
if err != nil {
if len(output) > 0 {
Expand Down