Skip to content

Commit

Permalink
Merge pull request #20 from x1unix/main
Browse files Browse the repository at this point in the history
fix: use correct ENODATA value on different platforms
  • Loading branch information
CalebQ42 authored Mar 18, 2023
2 parents e9e967f + 653c4a1 commit 1ae5593
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 5 deletions.
4 changes: 2 additions & 2 deletions fuse2.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func (f fileNode2) ReadAll(ctx context.Context) ([]byte, error) {
_, err := f.WriteTo(&buf)
return buf.Bytes(), err
}
return nil, fuse.ENODATA
return nil, ENODATA
}

func (f fileNode2) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.ReadResponse) error {
Expand All @@ -112,7 +112,7 @@ func (f fileNode2) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.R
}
return nil
}
return fuse.ENODATA
return ENODATA
}

func (f fileNode2) ReadDirAll(ctx context.Context) (out []fuse.Dirent, err error) {
Expand Down
4 changes: 2 additions & 2 deletions fuse3.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func (f fileNode) ReadAll(ctx context.Context) ([]byte, error) {
_, err := f.WriteTo(&buf)
return buf.Bytes(), err
}
return nil, fuse.ENODATA
return nil, ENODATA
}

func (f fileNode) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.ReadResponse) error {
Expand All @@ -110,7 +110,7 @@ func (f fileNode) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.Re
}
return nil
}
return fuse.ENODATA
return ENODATA
}

func (f fileNode) ReadDirAll(ctx context.Context) (out []fuse.Dirent, err error) {
Expand Down
7 changes: 7 additions & 0 deletions fuse_darwin.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package squashfs

import (
"golang.org/x/sys/unix"
)

var ENODATA = unix.Errno(unix.ENODATA)
3 changes: 3 additions & 0 deletions fuse_linux.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package squashfs

var ENODATA = fuse.ENODATA
3 changes: 3 additions & 0 deletions fuse_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package squashfs

var ENODATA = windows.Errno(windows.ENODATA)
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ require (

require (
github.com/seaweedfs/fuse v1.2.2
golang.org/x/sys v0.2.0 // indirect
golang.org/x/sys v0.6.0 // indirect
)
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8=
github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A=
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=

0 comments on commit 1ae5593

Please sign in to comment.