mirror of
https://github.com/rclone/rclone.git
synced 2025-12-11 22:14:05 +01:00
cmount: make work under OpenBSD - fixes #1727
Some checks failed
build / windows (push) Has been cancelled
build / other_os (push) Has been cancelled
build / mac_amd64 (push) Has been cancelled
build / mac_arm64 (push) Has been cancelled
build / linux (push) Has been cancelled
build / go1.24 (push) Has been cancelled
build / linux_386 (push) Has been cancelled
build / lint (push) Has been cancelled
build / android-all (push) Has been cancelled
Build & Push Docker Images / Build Docker Image for linux/386 (push) Has been cancelled
Build & Push Docker Images / Build Docker Image for linux/amd64 (push) Has been cancelled
Build & Push Docker Images / Build Docker Image for linux/arm/v6 (push) Has been cancelled
Build & Push Docker Images / Build Docker Image for linux/arm/v7 (push) Has been cancelled
Build & Push Docker Images / Build Docker Image for linux/arm64 (push) Has been cancelled
Build & Push Docker Images / Merge & Push Final Docker Image (push) Has been cancelled
Some checks failed
build / windows (push) Has been cancelled
build / other_os (push) Has been cancelled
build / mac_amd64 (push) Has been cancelled
build / mac_arm64 (push) Has been cancelled
build / linux (push) Has been cancelled
build / go1.24 (push) Has been cancelled
build / linux_386 (push) Has been cancelled
build / lint (push) Has been cancelled
build / android-all (push) Has been cancelled
Build & Push Docker Images / Build Docker Image for linux/386 (push) Has been cancelled
Build & Push Docker Images / Build Docker Image for linux/amd64 (push) Has been cancelled
Build & Push Docker Images / Build Docker Image for linux/arm/v6 (push) Has been cancelled
Build & Push Docker Images / Build Docker Image for linux/arm/v7 (push) Has been cancelled
Build & Push Docker Images / Build Docker Image for linux/arm64 (push) Has been cancelled
Build & Push Docker Images / Merge & Push Final Docker Image (push) Has been cancelled
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
//go:build cmount && ((linux && cgo) || (darwin && cgo) || (freebsd && cgo) || windows)
|
//go:build cmount && ((linux && cgo) || (darwin && cgo) || (freebsd && cgo) || (openbsd && cgo) || windows)
|
||||||
|
|
||||||
package cmount
|
package cmount
|
||||||
|
|
||||||
@@ -6,6 +6,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
@@ -210,6 +211,12 @@ func (fsys *FS) Readdir(dirPath string,
|
|||||||
// We can't seek in directories and FUSE should know that so
|
// We can't seek in directories and FUSE should know that so
|
||||||
// return an error if ofst is ever set.
|
// return an error if ofst is ever set.
|
||||||
if ofst > 0 {
|
if ofst > 0 {
|
||||||
|
// However openbsd doesn't seem to know this - perhaps a bug in its
|
||||||
|
// FUSE implementation or a bug in cgofuse?
|
||||||
|
// See: https://github.com/billziss-gh/cgofuse/issues/49
|
||||||
|
if runtime.GOOS == "openbsd" {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
return -fuse.ESPIPE
|
return -fuse.ESPIPE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
//go:build cmount && ((linux && cgo) || (darwin && cgo) || (freebsd && cgo) || windows)
|
//go:build cmount && ((linux && cgo) || (darwin && cgo) || (freebsd && cgo) || (openbsd && cgo) || windows)
|
||||||
|
|
||||||
// Package cmount implements a FUSE mounting system for rclone remotes.
|
// Package cmount implements a FUSE mounting system for rclone remotes.
|
||||||
//
|
//
|
||||||
@@ -8,9 +8,9 @@ package cmount
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
|
||||||
"os"
|
"os"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/rclone/rclone/cmd/mountlib"
|
"github.com/rclone/rclone/cmd/mountlib"
|
||||||
@@ -59,12 +59,14 @@ func mountOptions(VFS *vfs.VFS, device string, mountpoint string, opt *mountlib.
|
|||||||
} else {
|
} else {
|
||||||
options = append(options, "-o", "fsname="+device)
|
options = append(options, "-o", "fsname="+device)
|
||||||
options = append(options, "-o", "subtype=rclone")
|
options = append(options, "-o", "subtype=rclone")
|
||||||
options = append(options, "-o", fmt.Sprintf("max_readahead=%d", opt.MaxReadAhead))
|
if runtime.GOOS != "openbsd" {
|
||||||
// This causes FUSE to supply O_TRUNC with the Open
|
options = append(options, "-o", fmt.Sprintf("max_readahead=%d", opt.MaxReadAhead))
|
||||||
// call which is more efficient for cmount. However
|
// This causes FUSE to supply O_TRUNC with the Open
|
||||||
// it does not work with cgofuse on Windows with
|
// call which is more efficient for cmount. However
|
||||||
// WinFSP so cmount must work with or without it.
|
// it does not work with cgofuse on Windows with
|
||||||
options = append(options, "-o", "atomic_o_trunc")
|
// WinFSP so cmount must work with or without it.
|
||||||
|
options = append(options, "-o", "atomic_o_trunc")
|
||||||
|
}
|
||||||
if opt.DaemonTimeout != 0 {
|
if opt.DaemonTimeout != 0 {
|
||||||
options = append(options, "-o", fmt.Sprintf("daemon_timeout=%d", int(time.Duration(opt.DaemonTimeout).Seconds())))
|
options = append(options, "-o", fmt.Sprintf("daemon_timeout=%d", int(time.Duration(opt.DaemonTimeout).Seconds())))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
//go:build cmount && ((linux && cgo) || (darwin && cgo) || (freebsd && cgo) || windows) && (!race || !windows)
|
//go:build cmount && ((linux && cgo) || (darwin && cgo) || (freebsd && cgo) || (openbsd && cgo) || windows) && (!race || !windows)
|
||||||
|
|
||||||
// Package cmount implements a FUSE mounting system for rclone remotes.
|
// Package cmount implements a FUSE mounting system for rclone remotes.
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
//go:build !((linux && cgo && cmount) || (darwin && cgo && cmount) || (freebsd && cgo && cmount) || (windows && cmount))
|
//go:build !((linux && cgo && cmount) || (darwin && cgo && cmount) || (freebsd && cgo && cmount) || (openbsd && cgo && cmount) || (windows && cmount))
|
||||||
|
|
||||||
// Package cmount implements a FUSE mounting system for rclone remotes.
|
// Package cmount implements a FUSE mounting system for rclone remotes.
|
||||||
//
|
//
|
||||||
|
|||||||
Reference in New Issue
Block a user