Add support for indexing symlinks as such. Use inode/directory instead of application/x-fsdirectory as directory mime type. Fix stat/lstat usage in places (wipedir)

This commit is contained in:
Jean-Francois Dockes
2013-04-17 18:34:02 +02:00
parent de0fd43895
commit caf5d105df
14 changed files with 106 additions and 19 deletions
+1 -1
View File
@@ -399,7 +399,7 @@ FsTreeWalker::Status FsTreeWalker::iwalk(const string &top,
if ((status = cb.processone(top, &st, FtwDirReturn))
& (FtwStop|FtwError))
goto out;
} else if (S_ISREG(st.st_mode)) {
} else if (S_ISREG(st.st_mode) || S_ISLNK(st.st_mode)) {
if ((status = cb.processone(fn, &st, FtwRegular)) &
(FtwStop|FtwError)) {
goto out;
+2 -2
View File
@@ -41,7 +41,7 @@ int wipedir(const string& dir, bool selfalso, bool recurse)
int statret;
int ret = -1;
statret = stat(dir.c_str(), &st);
statret = lstat(dir.c_str(), &st);
if (statret == -1) {
LOGERR(("wipedir: cant stat %s, errno %d\n", dir.c_str(), errno));
return -1;
@@ -70,7 +70,7 @@ int wipedir(const string& dir, bool selfalso, bool recurse)
string fn = path_cat(dir, ent->d_name);
struct stat st;
int statret = stat(fn.c_str(), &st);
int statret = lstat(fn.c_str(), &st);
if (statret == -1) {
LOGERR(("wipedir: cant stat %s, errno %d\n", fn.c_str(), errno));
goto out;