forked from influxdata/telegraf
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix postfix plugin age to use ctime, not mtime (influxdata#3525)
- Loading branch information
1 parent
2c70958
commit bf65e19
Showing
5 changed files
with
63 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// +build !dragonfly,!linux,!netbsd,!openbsd,!solaris,!darwin,!freebsd | ||
|
||
package postfix | ||
|
||
func statCTime(_ interface{}) time.Time { | ||
return time.Time{} | ||
} |