From 9f30dcbe5be197894515a338a9bda9253567ea8f Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 24 Apr 2017 21:17:24 -0700 Subject: [PATCH] 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/41672 Reviewed-by: Brad Fitzpatrick --- unix/syscall_dragonfly.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unix/syscall_dragonfly.go b/unix/syscall_dragonfly.go index 3363456f..e76ab717 100644 --- a/unix/syscall_dragonfly.go +++ b/unix/syscall_dragonfly.go @@ -57,7 +57,7 @@ func nametomib(name string) (mib []_C_int, err error) { } 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) { @@ -65,7 +65,7 @@ func direntReclen(buf []byte) (uint64, bool) { if !ok { return 0, false } - return (16 + namlen + 1 + 7) & ^7, true + return (16 + namlen + 1 + 7) &^ 7, true } func direntNamlen(buf []byte) (uint64, bool) {