Commit 9f30dcbe authored by Ian Lance Taylor's avatar Ian Lance Taylor

unix: fix build on DragonFly BSD

The code was broken such that it didn't compile. With this fix, it compiles.

Fixes golang/go#20055.

Change-Id: I9aeb4900f2c99b2ad254be75b4987913cae71e14
Reviewed-on: https://go-review.googlesource.com/41672Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 8c0a5eac
...@@ -57,7 +57,7 @@ func nametomib(name string) (mib []_C_int, err error) { ...@@ -57,7 +57,7 @@ func nametomib(name string) (mib []_C_int, err error) {
} }
func direntIno(buf []byte) (uint64, bool) { func direntIno(buf []byte) (uint64, bool) {
return readInt(buf, unsafe.Offsetof(Dirent{}.Ino), unsafe.Sizeof(Dirent{}.Ino)) return readInt(buf, unsafe.Offsetof(Dirent{}.Fileno), unsafe.Sizeof(Dirent{}.Fileno))
} }
func direntReclen(buf []byte) (uint64, bool) { func direntReclen(buf []byte) (uint64, bool) {
...@@ -65,7 +65,7 @@ func direntReclen(buf []byte) (uint64, bool) { ...@@ -65,7 +65,7 @@ func direntReclen(buf []byte) (uint64, bool) {
if !ok { if !ok {
return 0, false return 0, false
} }
return (16 + namlen + 1 + 7) & ^7, true return (16 + namlen + 1 + 7) &^ 7, true
} }
func direntNamlen(buf []byte) (uint64, bool) { func direntNamlen(buf []byte) (uint64, bool) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment