Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2072)

Unified Diff: base/file_util_posix.cc

Issue 40162: Cleanup in {test_,}file_util_posix.cc (Closed)
Patch Set: 777, but with comment Created 11 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/test_file_util_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_util_posix.cc
diff --git a/base/file_util_posix.cc b/base/file_util_posix.cc
index 6d3984e349fae177592d443680a6cbb887c25c57..85cdc10fbba8844e6d63bad57a527d70af494401 100644
--- a/base/file_util_posix.cc
+++ b/base/file_util_posix.cc
@@ -142,7 +142,7 @@ bool CopyDirectory(const FilePath& from_path,
std::string suffix(&ent->fts_path[from_path.value().size()]);
// Strip the leading '/' (if any).
if (!suffix.empty()) {
- DCHECK(suffix[0] == '/');
+ DCHECK_EQ('/', suffix[0]);
suffix.erase(0, 1);
}
const FilePath target_path = to_path.Append(suffix);
@@ -157,6 +157,7 @@ bool CopyDirectory(const FilePath& from_path,
}
// Try creating the target dir, continuing on it if it exists already.
+ // Rely on the user's umask to produce correct permissions.
if (mkdir(target_path.value().c_str(), 0777) != 0) {
if (errno != EEXIST)
error = errno;
@@ -185,10 +186,12 @@ bool CopyDirectory(const FilePath& from_path,
break;
case FTS_SL: // Symlink.
case FTS_SLNONE: // Symlink with broken target.
- LOG(WARNING) << "CopyDirectory() skipping symbolic link.";
+ LOG(WARNING) << "CopyDirectory() skipping symbolic link: " <<
+ ent->fts_path;
continue;
case FTS_DEFAULT: // Some other sort of file.
- LOG(WARNING) << "CopyDirectory() skipping weird file.";
+ LOG(WARNING) << "CopyDirectory() skipping file of unknown type: " <<
+ ent->fts_path;
continue;
default:
NOTREACHED();
« no previous file with comments | « no previous file | base/test_file_util_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698