mirror of
https://github.com/containers/podman.git
synced 2025-06-01 01:00:22 +08:00

New pinned commit is 477e551dd493e5c80999d3690d3a201fd26ba2f1 Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #425 Approved by: rhatdan
21 lines
387 B
Go
21 lines
387 B
Go
// +build linux solaris
|
|
|
|
package storage
|
|
|
|
import (
|
|
"time"
|
|
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
// TouchedSince indicates if the lock file has been touched since the specified time
|
|
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.Mtim.Unix())
|
|
return when.Before(touched)
|
|
}
|