Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Commit

Permalink
Fix OSXFUSE 2.x detection logic
Browse files Browse the repository at this point in the history
Previous logic only worked when the 2.x kext was NOT loaded; that is,
right after boot. We only got it right if we needed to load the kext,
and the load helper binary wasn't found.

Instead, just probe for the mount helper binary, before doing anything
else. This costs an extra `stat(2)`, but keeps the code simple.
  • Loading branch information
tv42 committed Sep 10, 2015
1 parent 3c03e2f commit 808be62
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions mount_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,15 @@ func mount(dir string, conf *mountConfig, ready chan<- struct{}, errp *error) (*
}
}
for _, loc := range locations {
if _, err := os.Stat(loc.Mount); os.IsNotExist(err) {
// try the other locations
continue
}

f, err := openOSXFUSEDev(loc.DevicePrefix)
if err == errNotLoaded {
err = loadOSXFUSE(loc.Load)
if err != nil {
if os.IsNotExist(err) {
// try the other locations
continue
}
return nil, err
}
// try again
Expand Down

0 comments on commit 808be62

Please sign in to comment.