mirror of
https://github.com/zeek/zeek.git
synced 2025-10-11 11:08:20 +00:00
Improve input framework re-read logic
Changed from checking for "has newer modification time" to "has different modification time or inode number".
This commit is contained in:
parent
5c9813eadb
commit
f41f392743
12 changed files with 38 additions and 19 deletions
|
@ -49,6 +49,7 @@ FieldMapping FieldMapping::subType()
|
|||
Ascii::Ascii(ReaderFrontend *frontend) : ReaderBackend(frontend)
|
||||
{
|
||||
mtime = 0;
|
||||
ino = 0;
|
||||
suppress_warnings = false;
|
||||
fail_on_file_problem = false;
|
||||
fail_on_invalid_lines = false;
|
||||
|
@ -281,10 +282,12 @@ bool Ascii::DoUpdate()
|
|||
return ! fail_on_file_problem;
|
||||
}
|
||||
|
||||
if ( sb.st_mtime <= mtime ) // no change
|
||||
if ( sb.st_ino == ino && sb.st_mtime == mtime )
|
||||
// no change
|
||||
return true;
|
||||
|
||||
mtime = sb.st_mtime;
|
||||
ino = sb.st_ino;
|
||||
// file changed. reread.
|
||||
|
||||
// fallthrough
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue