mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
prevent active log from being overwritten when agent starts (#11386)
This commit is contained in:
17
command/agent/log_file_linux.go
Normal file
17
command/agent/log_file_linux.go
Normal file
@@ -0,0 +1,17 @@
|
||||
//go:build dragonfly || linux || solaris
|
||||
// +build dragonfly linux solaris
|
||||
|
||||
package agent
|
||||
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user