Skip to content

Commit

Permalink
allow non-root to mount in macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
davies committed Jan 15, 2021
1 parent 1d1582c commit 1fa52ba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 1 addition & 2 deletions cmd/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,7 @@ func mount(c *cli.Context) error {
}
err = fuse.Main(conf, c.String("o"), c.Float64("attrcacheto"), c.Float64("entrycacheto"), c.Float64("direntrycacheto"))
if err != nil {
logger.Errorf("%s", err)
os.Exit(1)
logger.Fatalf("fuse: %s", err)
}
return nil
}
Expand Down
5 changes: 4 additions & 1 deletion pkg/fuse/fuse.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,13 @@ import (

"github.com/juicedata/juicefs/pkg/meta"
vfs "github.com/juicedata/juicefs/pkg/vfs"
"github.com/juicedata/juicesync/utils"

"github.com/hanwen/go-fuse/v2/fuse"
)

var logger = utils.GetLogger("juicefs")

type JFS struct {
fuse.RawFileSystem
cacheMode int
Expand Down Expand Up @@ -403,7 +406,7 @@ func (fs *JFS) StatFs(cancel <-chan struct{}, in *fuse.InHeader, out *fuse.Statf

func Main(conf *vfs.Config, options string, attrcacheto_, entrycacheto_, direntrycacheto_ float64) error {
if err := syscall.Setpriority(syscall.PRIO_PROCESS, os.Getpid(), -19); err != nil {
return err
logger.Warnf("setpriority: %s", err)
}

imp := NewJFS()
Expand Down

0 comments on commit 1fa52ba

Please sign in to comment.