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:
Jon Siwek 2018-08-24 12:46:31 -05:00
parent 5c9813eadb
commit f41f392743
12 changed files with 38 additions and 19 deletions

View file

@ -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