Added to vendor

This commit is contained in:
Priya Wadhwa
2018-02-28 12:22:10 -08:00
parent 3ce3dca56d
commit 66bb59ff12
602 changed files with 230607 additions and 5 deletions
+20
View File
@@ -0,0 +1,20 @@
// +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)
}