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:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user