diff --git a/src/IOCoordinator.cpp b/src/IOCoordinator.cpp index 5841af235..574cd1c05 100755 --- a/src/IOCoordinator.cpp +++ b/src/IOCoordinator.cpp @@ -336,19 +336,13 @@ int IOCoordinator::open(const char *filename, int openmode, struct stat *out) if (openmode & O_CREAT) { MetadataFile meta(filename); - meta.stat(out); + return meta.stat(out); } else { MetadataFile meta(filename, MetadataFile::no_create_t()); - if (!meta.exists()) - { - errno = ENOENT; - return -1; - } - meta.stat(out); + return meta.stat(out); } - return 0; #if 0 int fd, err; diff --git a/src/MetadataFile.cpp b/src/MetadataFile.cpp index f10aa9084..94288e51f 100755 --- a/src/MetadataFile.cpp +++ b/src/MetadataFile.cpp @@ -196,12 +196,8 @@ int MetadataFile::stat(struct stat *out) const { int err = ::stat(mFilename.c_str(), out); if (err) - { - cout << "Failed to stat " << mFilename << endl; return err; - } - - cout << "Got the stat for " << mFilename << endl; + size_t totalSize = 0; for (auto &object : mObjects) totalSize += object.length;