Centralize stat calls to ensure consistency of time fields on windows
This commit is contained in:
@@ -342,7 +342,7 @@ bool BeagleQueueIndexer::indexFiles(list<string>& files)
|
||||
it++; continue;
|
||||
}
|
||||
struct stat st;
|
||||
if (lstat(it->c_str(), &st) != 0) {
|
||||
if (path_fileprops(*it, &st) != 0) {
|
||||
LOGERR(("BeagleQueueIndexer::indexfiles: cant stat [%s]\n",
|
||||
it->c_str()));
|
||||
it++; continue;
|
||||
|
||||
@@ -21,11 +21,11 @@
|
||||
|
||||
#include "debuglog.h"
|
||||
#include "cstr.h"
|
||||
|
||||
#include "fetcher.h"
|
||||
#include "fsfetcher.h"
|
||||
#include "fsindexer.h"
|
||||
#include "debuglog.h"
|
||||
#include "pathut.h"
|
||||
|
||||
using std::string;
|
||||
|
||||
@@ -43,7 +43,7 @@ static bool urltopath(RclConfig* cnf,
|
||||
bool follow = false;
|
||||
cnf->getConfParam("followLinks", &follow);
|
||||
|
||||
if ((follow ? stat(fn.c_str(), &st) : lstat(fn.c_str(), &st))< 0) {
|
||||
if (path_fileprops(fn, &st, follow) < 0) {
|
||||
LOGERR(("FSDocFetcher::fetch: stat errno %d for [%s]\n",
|
||||
errno, fn.c_str()));
|
||||
return false;
|
||||
|
||||
@@ -362,10 +362,9 @@ bool FsIndexer::indexFiles(list<string>& files, int flags)
|
||||
}
|
||||
|
||||
struct stat stb;
|
||||
int ststat = follow ? stat(it->c_str(), &stb) :
|
||||
lstat(it->c_str(), &stb);
|
||||
int ststat = path_fileprops(*it, &stb, follow);
|
||||
if (ststat != 0) {
|
||||
LOGERR(("FsIndexer::indexFiles: lstat(%s): %s", it->c_str(),
|
||||
LOGERR(("FsIndexer::indexFiles: (l)stat %s: %s", it->c_str(),
|
||||
strerror(errno)));
|
||||
it++;
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user