From a91ad29d362e8cb5348766da637202ac8905b9f2 Mon Sep 17 00:00:00 2001
From: Jakob Unterwurzacher
Date: Sat, 15 May 2021 17:19:49 +0200
Subject: 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.
---
 internal/fusefrontend/node.go | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

(limited to 'internal/fusefrontend')

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.
-- 
cgit v1.2.3