Skip to content

Commit a780d6d

Browse files
committed
fs/stat: add FreeBSD
This forwards the build-tag from containerd/containerd: containerd/containerd@4c47fe0 Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 7f42732 commit a780d6d

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// +build darwin freebsd
1+
// +build darwin freebsd netbsd
22

33
/*
44
Copyright The containerd Authors.
@@ -40,5 +40,5 @@ func StatMtime(st *syscall.Stat_t) syscall.Timespec {
4040

4141
// StatATimeAsTime returns the access time as a time.Time
4242
func StatATimeAsTime(st *syscall.Stat_t) time.Time {
43-
return time.Unix(int64(st.Atimespec.Sec), int64(st.Atimespec.Nsec)) // nolint: unconvert
43+
return time.Unix(int64(st.Atimespec.Sec), int64(st.Atimespec.Nsec)) //nolint: unconvert // int64 conversions ensure the line compiles for 32-bit systems as well.
4444
}

fs/stat_linuxopenbsd.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,5 @@ func StatMtime(st *syscall.Stat_t) syscall.Timespec {
4040

4141
// StatATimeAsTime returns st.Atim as a time.Time
4242
func StatATimeAsTime(st *syscall.Stat_t) time.Time {
43-
// The int64 conversions ensure the line compiles for 32-bit systems as well.
44-
return time.Unix(int64(st.Atim.Sec), int64(st.Atim.Nsec)) // nolint: unconvert
43+
return time.Unix(int64(st.Atim.Sec), int64(st.Atim.Nsec)) //nolint: unconvert // int64 conversions ensure the line compiles for 32-bit systems as well.
4544
}

0 commit comments

Comments
 (0)