From 4c7095ccf60f6ae12c0f60e99e0a5e3dc4ccfb94 Mon Sep 17 00:00:00 2001 From: Antonio SJ Musumeci Date: Tue, 27 May 2014 12:41:40 -0400 Subject: [PATCH] remove stat'ing of files in readdir. closes #3 --- src/readdir.cpp | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/readdir.cpp b/src/readdir.cpp index 19c61738..475d0854 100644 --- a/src/readdir.cpp +++ b/src/readdir.cpp @@ -69,25 +69,11 @@ _readdir(const vector &srcmounts, for(struct dirent *de = ::readdir(dh); de != NULL; de = ::readdir(dh)) { string d_name(de->d_name); - pair::iterator,bool> ret; - ret = found.insert(d_name); - if(ret.second == false) + if(found.insert(d_name).second == false) continue; - { - struct stat st; - string path; - - path = fs::make_path(basepath,d_name); - if(::lstat(path.c_str(),&st) == -1) - { - found.erase(ret.first); - continue; - } - - filler(buf,de->d_name,&st,NO_OFFSET); - } + filler(buf,de->d_name,NULL,NO_OFFSET); } ::closedir(dh);