2018-02-05 21:05:59 +00:00
|
|
|
package archive // import "github.com/docker/docker/pkg/archive"
|
2014-04-28 23:31:58 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"syscall"
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
func timeToTimespec(time time.Time) (ts syscall.Timespec) {
|
|
|
|
if time.IsZero() {
|
|
|
|
// Return UTIME_OMIT special value
|
|
|
|
ts.Sec = 0
|
2018-05-19 11:38:54 +00:00
|
|
|
ts.Nsec = (1 << 30) - 2
|
2014-04-28 23:31:58 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
return syscall.NsecToTimespec(time.UnixNano())
|
|
|
|
}
|