~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/cached_directory.cc

  • Committer: Lee Bieber
  • Date: 2011-03-29 20:41:26 UTC
  • mfrom: (2241.5.3 bug738022)
  • mto: This revision was merged to the branch mainline in revision 2258.
  • Revision ID: kalebral@gmail.com-20110329204126-6dl7yq6rdohk77i6
Merge Stewart - 738022: CachedDirectory silently fails to add entries if stat() fails

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
 
40
40
#include <drizzled/cached_directory.h>
41
41
#include <drizzled/util/find_ptr.h>
 
42
#include <drizzled/error_t.h>
 
43
#include <drizzled/error.h>
 
44
#include <drizzled/errmsg_print.h>
42
45
 
43
46
using namespace std;
 
47
using namespace drizzled;
44
48
 
45
49
namespace drizzled {
46
50
 
155
159
 
156
160
          buffered_fullpath.append(result->d_name);
157
161
 
158
 
          stat(buffered_fullpath.c_str(), &entrystat);
159
 
 
160
 
          if (S_ISDIR(entrystat.st_mode))
 
162
          int err= stat(buffered_fullpath.c_str(), &entrystat);
 
163
 
 
164
          if (err != 0)
 
165
            errmsg_printf(error::WARN, ER(ER_CANT_GET_STAT),
 
166
                          buffered_fullpath.c_str(),
 
167
                          errno);
 
168
 
 
169
          if (err == 0 && S_ISDIR(entrystat.st_mode))
161
170
          {
162
171
            entries.push_back(new Entry(result->d_name));
163
172
          }