Fix postfix plugin age to use ctime, not mtime (#3525)
This commit is contained in:
committed by
Daniel Nelson
parent
eca20036b7
commit
b6e8214396
16
plugins/inputs/postfix/stat_ctim.go
Normal file
16
plugins/inputs/postfix/stat_ctim.go
Normal file
@@ -0,0 +1,16 @@
|
||||
// +build dragonfly linux netbsd openbsd solaris
|
||||
|
||||
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.Ctim.Unix())
|
||||
}
|
||||
Reference in New Issue
Block a user