git: 95c0d83d6082 - main - net/rclone: Fix /dev/fuse polling issue

From: Dmitri Goutnik <dmgk_at_FreeBSD.org>
Date: Mon, 15 Aug 2022 14:17:33 UTC
The branch main has been updated by dmgk:

URL: https://cgit.FreeBSD.org/ports/commit/?id=95c0d83d6082be7af1f380d4f5858c2fd1fdfac2

commit 95c0d83d6082be7af1f380d4f5858c2fd1fdfac2
Author:     Dmitri Goutnik <dmgk@FreeBSD.org>
AuthorDate: 2022-08-15 14:07:58 +0000
Commit:     Dmitri Goutnik <dmgk@FreeBSD.org>
CommitDate: 2022-08-15 14:12:13 +0000

    net/rclone: Fix /dev/fuse polling issue
    
    Apply bazil/fuse workaround from [1], bump PORTREVISION.
    
    [1] https://github.com/golang/go/issues/54100#issuecomment-1200165500
    
    PR:             258056
    Approved by:    Ralf van der Enden <tremere@cainites.net> (maintainer)
---
 net/rclone/Makefile                                       |  2 +-
 .../files/patch-vendor_bazil.org_fuse_mount__freebsd.go   | 15 +++++++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/net/rclone/Makefile b/net/rclone/Makefile
index 56b5edde8dab..82fb0be342df 100644
--- a/net/rclone/Makefile
+++ b/net/rclone/Makefile
@@ -1,7 +1,7 @@
 PORTNAME=	rclone
 DISTVERSIONPREFIX=	v
 DISTVERSION=	1.59.0
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	net
 
 MAINTAINER=	tremere@cainites.net
diff --git a/net/rclone/files/patch-vendor_bazil.org_fuse_mount__freebsd.go b/net/rclone/files/patch-vendor_bazil.org_fuse_mount__freebsd.go
new file mode 100644
index 000000000000..6e65abfd799a
--- /dev/null
+++ b/net/rclone/files/patch-vendor_bazil.org_fuse_mount__freebsd.go
@@ -0,0 +1,15 @@
+--- vendor/bazil.org/fuse/mount_freebsd.go.orig	2022-08-09 15:43:51 UTC
++++ vendor/bazil.org/fuse/mount_freebsd.go
+@@ -56,10 +56,11 @@ func mount(dir string, conf *mountConfig) (*os.File, e
+ 		}
+ 	}
+ 
+-	f, err := os.OpenFile("/dev/fuse", os.O_RDWR, 0o000)
++	fd, err := syscall.Open("/dev/fuse", os.O_RDWR|syscall.O_CLOEXEC, 0o000)
+ 	if err != nil {
+ 		return nil, err
+ 	}
++	f := os.NewFile(uintptr(fd), "/dev/fuse")
+ 
+ 	cmd := exec.Command(
+ 		"/sbin/mount_fusefs",