Fix postfix plugin age to use ctime, not mtime (#3525)
This commit is contained in:
committed by
Daniel Nelson
parent
2c70958c24
commit
bf65e19486
16
plugins/inputs/postfix/stat_ctimespec.go
Normal file
16
plugins/inputs/postfix/stat_ctimespec.go
Normal file
@@ -0,0 +1,16 @@
|
||||
// +build darwin freebsd
|
||||
|
||||
package postfix
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"time"
|
||||
)
|
||||
|
||||
func statCTime(sys interface{}) time.Time {
|
||||
stat, ok := sys.(*syscall.Stat_t)
|
||||
if !ok {
|
||||
return time.Time{}
|
||||
}
|
||||
return time.Unix(stat.Ctimespec.Unix())
|
||||
}
|
||||
Reference in New Issue
Block a user