mirror of https://github.com/hashicorp/consul
18 lines
375 B
Go
18 lines
375 B
Go
|
//go:build dragonfly || linux
|
||
|
// +build dragonfly linux
|
||
|
|
||
|
package logging
|
||
|
|
||
|
import (
|
||
|
"os"
|
||
|
"syscall"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
func (l *LogFile) createTime(stat os.FileInfo) time.Time {
|
||
|
stat_t := stat.Sys().(*syscall.Stat_t)
|
||
|
createTime := stat_t.Ctim
|
||
|
// Sec and Nsec are int32 in 32-bit architectures.
|
||
|
return time.Unix(int64(createTime.Sec), int64(createTime.Nsec)) //nolint:unconvert
|
||
|
}
|