summaryrefslogtreecommitdiff
path: root/internal/fusefrontend
diff options
context:
space:
mode:
authorJakob Unterwurzacher2021-05-15 17:19:49 +0200
committerJakob Unterwurzacher2021-05-15 17:20:43 +0200
commita91ad29d362e8cb5348766da637202ac8905b9f2 (patch)
tree76d1a38fb4e7ea6a203dffef9adae8b5ea898da5 /internal/fusefrontend
parent1ba2e42234b973260066623bb7eeda4c8b936d8e (diff)
fusefrontend: fix RENAME_NOREPLACE darwin build failure
Error was: internal/fusefrontend/node.go:371:2: duplicate case syscallcompat.RENAME_NOREPLACE (value 0) in switch previous case at internal/fusefrontend/node.go:368:7 Rewrite using "if"s instead.
Diffstat (limited to 'internal/fusefrontend')
-rw-r--r--internal/fusefrontend/node.go17
1 files changed, 8 insertions, 9 deletions
diff --git a/internal/fusefrontend/node.go b/internal/fusefrontend/node.go
index 543926d..87effca 100644
--- a/internal/fusefrontend/node.go
+++ b/internal/fusefrontend/node.go
@@ -364,18 +364,17 @@ func (n *Node) Symlink(ctx context.Context, target, name string, out *fuse.Entry
// Reject those flags with syscall.EINVAL.
// If we can handle the flags, this function returns 0.
func rejectRenameFlags(flags uint32) syscall.Errno {
- switch flags {
- case 0:
- // Normal rename, we can handle that
+ // Normal rename, we can handle that
+ if flags == 0 {
return 0
- case syscallcompat.RENAME_NOREPLACE:
- // We also can handle RENAME_NOREPLACE
+ }
+ // We also can handle RENAME_NOREPLACE
+ if flags == syscallcompat.RENAME_NOREPLACE {
return 0
- default:
- // We cannot handle RENAME_EXCHANGE and RENAME_WHITEOUT yet -
- // needs extra code for .name files.
- return syscall.EINVAL
}
+ // We cannot handle RENAME_EXCHANGE and RENAME_WHITEOUT yet.
+ // Needs extra code for .name files.
+ return syscall.EINVAL
}
// Rename - FUSE call.