Observe followSymlinks in indexfiles()
This commit is contained in:
parent
8f8a1dfb3b
commit
d084ac9899
1 changed files with 9 additions and 4 deletions
|
@ -274,8 +274,10 @@ bool FsIndexer::indexFiles(list<string>& files, ConfIndexer::IxFlag flag)
|
||||||
m_config->setKeyDir(path_getfather(*it));
|
m_config->setKeyDir(path_getfather(*it));
|
||||||
if (m_havelocalfields)
|
if (m_havelocalfields)
|
||||||
localfieldsfromconf();
|
localfieldsfromconf();
|
||||||
walker.setSkippedNames(m_config->getSkippedNames());
|
bool follow = false;
|
||||||
|
m_config->getConfParam("followLinks", &follow);
|
||||||
|
|
||||||
|
walker.setSkippedNames(m_config->getSkippedNames());
|
||||||
// Check path against indexed areas and skipped names/paths
|
// Check path against indexed areas and skipped names/paths
|
||||||
if (!(flag&ConfIndexer::IxFIgnoreSkip) &&
|
if (!(flag&ConfIndexer::IxFIgnoreSkip) &&
|
||||||
matchesSkipped(m_tdl, walker, *it)) {
|
matchesSkipped(m_tdl, walker, *it)) {
|
||||||
|
@ -283,7 +285,9 @@ bool FsIndexer::indexFiles(list<string>& files, ConfIndexer::IxFlag flag)
|
||||||
}
|
}
|
||||||
|
|
||||||
struct stat stb;
|
struct stat stb;
|
||||||
if (lstat(it->c_str(), &stb) != 0) {
|
int ststat = follow ? stat(it->c_str(), &stb) :
|
||||||
|
lstat(it->c_str(), &stb);
|
||||||
|
if (ststat != 0) {
|
||||||
LOGERR(("FsIndexer::indexFiles: lstat(%s): %s", it->c_str(),
|
LOGERR(("FsIndexer::indexFiles: lstat(%s): %s", it->c_str(),
|
||||||
strerror(errno)));
|
strerror(errno)));
|
||||||
it++; continue;
|
it++; continue;
|
||||||
|
@ -369,11 +373,12 @@ void *FsIndexerDbUpdWorker(void * fsp)
|
||||||
|
|
||||||
DbUpdTask *tsk;
|
DbUpdTask *tsk;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (!tqp->take(&tsk)) {
|
size_t qsz;
|
||||||
|
if (!tqp->take(&tsk, &qsz)) {
|
||||||
tqp->workerExit();
|
tqp->workerExit();
|
||||||
return (void*)1;
|
return (void*)1;
|
||||||
}
|
}
|
||||||
LOGDEB(("FsIndexerDbUpdWorker: got task, ql %d\n", int(tqp->size())));
|
LOGDEB(("FsIndexerDbUpdWorker: got task, ql %d\n", int(qsz)));
|
||||||
if (!fip->m_db->addOrUpdate(tsk->config, tsk->udi, tsk->parent_udi,
|
if (!fip->m_db->addOrUpdate(tsk->config, tsk->udi, tsk->parent_udi,
|
||||||
tsk->doc)) {
|
tsk->doc)) {
|
||||||
LOGERR(("FsIndexerDbUpdWorker: addOrUpdate failed\n"));
|
LOGERR(("FsIndexerDbUpdWorker: addOrUpdate failed\n"));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue