mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-06 10:16:49 +02:00
20 lines
308 B
Go
20 lines
308 B
Go
// +build darwin freebsd
|
|
|
|
package storage
|
|
|
|
import (
|
|
"time"
|
|
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
func (l *lockfile) TouchedSince(when time.Time) bool {
|
|
st := unix.Stat_t{}
|
|
err := unix.Fstat(int(l.fd), &st)
|
|
if err != nil {
|
|
return true
|
|
}
|
|
touched := time.Unix(st.Mtimespec.Unix())
|
|
return when.Before(touched)
|
|
}
|