From abbdaa8ea4ca28b50304170986f0b6a271cda341 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sun, 4 Nov 2018 22:35:17 +0100 Subject: fusefrontend: fix compile failure on Darwin Failure was: + GOOS=darwin + GOARCH=amd64 + go build -tags without_openssl # github.com/rfjakob/gocryptfs/internal/fusefrontend internal/fusefrontend/fs_dir.go:159:60: cannot use origMode | 448 (type uint16) as type uint32 in argument to syscallcompat.Fchmodat internal/fusefrontend/fs_dir.go:170:33: cannot use origMode (type uint16) as type uint32 in argument to syscallcompat.Fchmodat --- internal/fusefrontend/fs_dir.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'internal/fusefrontend/fs_dir.go') diff --git a/internal/fusefrontend/fs_dir.go b/internal/fusefrontend/fs_dir.go index d4117fb..181ccb5 100644 --- a/internal/fusefrontend/fs_dir.go +++ b/internal/fusefrontend/fs_dir.go @@ -158,7 +158,8 @@ func (fs *FS) Rmdir(relPath string, context *fuse.Context) (code fuse.Status) { tlog.Debug.Printf("Rmdir: Stat: %v", err) return fuse.ToStatus(err) } - origMode := st.Mode & 0777 + // This cast is needed on Darwin, where st.Mode is uint16. + origMode := uint32(st.Mode & 0777) err = syscallcompat.Fchmodat(parentDirFd, cName, origMode|0700, unix.AT_SYMLINK_NOFOLLOW) if err != nil { tlog.Debug.Printf("Rmdir: Fchmodat failed: %v", err) -- cgit v1.2.3