Skip to content

Commit

Permalink
fix build errors on osx
Browse files Browse the repository at this point in the history
  • Loading branch information
vgough committed Jan 10, 2020
1 parent 0eb4044 commit 63132f6
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions fuse/bridge_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import "C"

import "time"

func (s *StatVfs) toCStat(o *C.struct_statvfs) {
func (s *StatVFS) toCStat(o *C.struct_statvfs) {
o.f_bsize = C.ulong(s.BlockSize)
o.f_blocks = C.fsblkcnt_t(s.Blocks)
o.f_bfree = C.fsblkcnt_t(s.BlocksFree)
Expand All @@ -24,31 +24,31 @@ func (s *StatVfs) toCStat(o *C.struct_statvfs) {
func (a *InoAttr) fromCStat(i *C.struct_stat) {
a.Ino = int64(i.st_ino)
a.Mode = int(i.st_mode)
a.Nlink = int(i.st_nlink)
a.NLink = int(i.st_nlink)
a.Size = int64(i.st_size)
var uid int = int(i.st_uid)
var gid int = int(i.st_gid)
a.Uid = &uid
a.Gid = &gid
a.Atim = time.Unix(int64(i.st_atimespec.tv_sec), int64(i.st_atimespec.tv_nsec))
a.Ctim = time.Unix(int64(i.st_ctimespec.tv_sec), int64(i.st_ctimespec.tv_nsec))
a.Mtim = time.Unix(int64(i.st_mtimespec.tv_sec), int64(i.st_mtimespec.tv_nsec))
a.UID = &uid
a.GID = &gid
a.ATime = time.Unix(int64(i.st_atimespec.tv_sec), int64(i.st_atimespec.tv_nsec))
a.CTime = time.Unix(int64(i.st_ctimespec.tv_sec), int64(i.st_ctimespec.tv_nsec))
a.MTime = time.Unix(int64(i.st_mtimespec.tv_sec), int64(i.st_mtimespec.tv_nsec))
}

func (a *InoAttr) toCStat(o *C.struct_stat, timeout *C.double) {
o.st_ino = C.__darwin_ino64_t(a.Ino)
o.st_mode = C.mode_t(a.Mode)
o.st_nlink = C.nlink_t(a.Nlink)
o.st_nlink = C.nlink_t(a.NLink)
o.st_size = C.off_t(a.Size)
if a.Uid != nil {
o.st_uid = C.uid_t(*a.Uid)
if a.UID != nil {
o.st_uid = C.uid_t(*a.UID)
}
if a.Gid != nil {
o.st_gid = C.gid_t(*a.Gid)
if a.GID != nil {
o.st_gid = C.gid_t(*a.GID)
}
toCTime(&o.st_ctimespec, a.Ctim)
toCTime(&o.st_mtimespec, a.Mtim)
toCTime(&o.st_atimespec, a.Atim)
toCTime(&o.st_ctimespec, a.CTime)
toCTime(&o.st_mtimespec, a.MTime)
toCTime(&o.st_atimespec, a.ATime)
if timeout != nil {
(*timeout) = C.double(a.Timeout)
}
Expand Down

0 comments on commit 63132f6

Please sign in to comment.