Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bsd builds #4848

Merged
merged 2 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
}
Loading