mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
4f0d95fa6e
Signed-off-by: Daniel Nephin <dnephin@docker.com>
16 lines
317 B
Go
16 lines
317 B
Go
package archive // import "github.com/docker/docker/pkg/archive"
|
|
|
|
import (
|
|
"syscall"
|
|
"time"
|
|
)
|
|
|
|
func timeToTimespec(time time.Time) (ts syscall.Timespec) {
|
|
if time.IsZero() {
|
|
// Return UTIME_OMIT special value
|
|
ts.Sec = 0
|
|
ts.Nsec = ((1 << 30) - 2)
|
|
return
|
|
}
|
|
return syscall.NsecToTimespec(time.UnixNano())
|
|
}
|