consul/logging/logfile_bsd.go
Ashesh Vidyut 13eefbb840
Net 3181 consul gh issue 15709 allow log file naming like nomad - fix bug (#18631)
* fixes file name for consul

* added log file

* added tests for rename method

* append instead of trunc

* fix file truncate issue

* added changelog

* fix for build destros ci

* removed changelog

* solaris
2023-09-01 14:53:31 +05:30

17 lines
343 B
Go

//go:build darwin || freebsd || netbsd || openbsd
// +build darwin freebsd netbsd openbsd
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.Ctimespec
return time.Unix(int64(createTime.Sec), int64(createTime.Nsec))
}