Commit 95230d45 authored by Jordan Sissel's avatar Jordan Sissel

- fix bug introduced during windows-support integration which caused

file rotation to always be incorrectly detected on linux.
parent 6f07d148
...@@ -9,13 +9,13 @@ import ( ...@@ -9,13 +9,13 @@ import (
func is_file_same(path string, info os.FileInfo, state *FileState) bool { func is_file_same(path string, info os.FileInfo, state *FileState) bool {
fstat := info.Sys().(*syscall.Stat_t) fstat := info.Sys().(*syscall.Stat_t)
return (fstat.Ino != state.Inode && fstat.Dev == state.Device) return (fstat.Ino == state.Inode && fstat.Dev == state.Device)
} }
func is_fileinfo_same(a os.FileInfo, b os.FileInfo) bool { func is_fileinfo_same(a os.FileInfo, b os.FileInfo) bool {
af := a.Sys().(*syscall.Stat_t) af := a.Sys().(*syscall.Stat_t)
bf := b.Sys().(*syscall.Stat_t) bf := b.Sys().(*syscall.Stat_t)
return (af.Dev != bf.Dev || af.Ino != bf.Ino) return (af.Dev == bf.Dev && af.Ino == bf.Ino)
} }
func is_file_renamed(file string, info os.FileInfo, fileinfo map[string]os.FileInfo) bool { func is_file_renamed(file string, info os.FileInfo, fileinfo map[string]os.FileInfo) bool {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment