Vincent Batts
4a65baf87b
I obviously bungled my attempt in #1391 so this is fixing that. Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
19 lines
308 B
Go
19 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)
|
|
}
|