Skip to content

Commit

Permalink
macos: look in alternate location for macfuse/osxfuse library
Browse files Browse the repository at this point in the history
With MacFUSE i.e. OSXFuse 4.0, the location of the loadable library
has changed to `/usr/local/lib/libfuse.2.dylib` instead of
`/usr/local/lib/libosxfuse.2.dylib`. The older path is still present
for backwards compatibility for the time being.

This patch looks in the newer location first, then in the older
location if that fails.

Release Notes: https://github.com/osxfuse/osxfuse/releases/tag/macfuse-4.0.0

Fixes winfsp#52
  • Loading branch information
ncw committed Feb 10, 2021
1 parent e0e91bc commit e31196c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fuse/host_cgo.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,9 @@ static void *cgofuse_init_fuse(void)
void *h;
#if defined(__APPLE__)
h = dlopen("/usr/local/lib/libosxfuse.2.dylib", RTLD_NOW);
h = dlopen("/usr/local/lib/libfuse.2.dylib", RTLD_NOW); // MacFUSE/OSXFuse >= v4
if (0 == h)
h = dlopen("/usr/local/lib/libosxfuse.2.dylib", RTLD_NOW); // MacFUSE/OSXFuse < v4
#elif defined(__FreeBSD__)
h = dlopen("libfuse.so.2", RTLD_NOW);
#elif defined(__NetBSD__)
Expand Down

0 comments on commit e31196c

Please sign in to comment.