BUG: wrong nanoseconds in highResLastModified (closes #794)

- was using st_atim instead of st_mtim for the nanoseconds

- value of followLink was being ignored (it was always being followed).
This commit is contained in:
Mark Olesen
2018-04-11 10:27:41 +02:00
parent 1eb2458cf5
commit 1ac7f2e873

View File

@ -57,10 +57,10 @@ Description
#include <sys/stat.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
#include <dlfcn.h>
#include <link.h>
#include <netinet/in.h>
#ifdef USE_RANDOM
#include <climits>
#if INT_MAX != 2147483647
@ -708,12 +708,12 @@ double Foam::highResLastModified(const fileName& name, const bool followLink)
// Ignore an empty name
if (!name.empty())
{
fileStat fileStatus(name);
fileStat fileStatus(name, followLink);
if (fileStatus.isValid())
{
return
fileStatus.status().st_mtime
+ 1e-9*fileStatus.status().st_atim.tv_nsec;
+ 1e-9*fileStatus.status().st_mtim.tv_nsec;
}
}