Skip to content

Commit

Permalink
Merge pull request #4848 from aduffeck/fix-bds-builds
Browse files Browse the repository at this point in the history
Fix bsd builds
  • Loading branch information
kobergj authored Sep 17, 2024
2 parents f8ace8c + 3a41e19 commit fb39458
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelog/unreleased/improve-posixfs.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ Enhancement: Add trashbin support to posixfs alongside other improvements

We added support for trashbins to posixfs. Posixfs also saw a number of other improvement, bugfixes and optimizations.

https://github.com/cs3org/reva/pull/4848
https://github.com/cs3org/reva/pull/4779

3 changes: 2 additions & 1 deletion pkg/storage/fs/posix/timemanager/timemanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ func (m *Manager) CTime(ctx context.Context, n *node.Node) (time.Time, error) {
}

stat := fi.Sys().(*syscall.Stat_t)
statCTime := StatCTime(stat)
//nolint:unconvert
return time.Unix(int64(stat.Ctim.Sec), int64(stat.Ctim.Nsec)), nil
return time.Unix(int64(statCTime.Sec), int64(statCTime.Nsec)), nil
}

// TCTime returns the tree creation time (tctime) of a node.
Expand Down
10 changes: 10 additions & 0 deletions pkg/storage/fs/posix/timemanager/timemanager_bsd.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//go:build darwin || freebsd || netbsd || openbsd

package timemanager

import "syscall"

// StatCtime returns the change time
func StatCTime(st *syscall.Stat_t) syscall.Timespec {
return st.Ctimespec
}
10 changes: 10 additions & 0 deletions pkg/storage/fs/posix/timemanager/timemanager_sysv.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//go:build dragonfly || linux || solaris

package timemanager

import "syscall"

// StatCtime returns the change time
func StatCTime(st *syscall.Stat_t) syscall.Timespec {
return st.Ctim
}

0 comments on commit fb39458

Please sign in to comment.