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

Unified Diff: chrome/browser/chromeos/gdata/gdata_cache_metadata.cc

Issue 10704062: gdata: Get rid of chmod() system call from gdata code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync Created 8 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/gdata/gdata_cache_metadata.cc
diff --git a/chrome/browser/chromeos/gdata/gdata_cache_metadata.cc b/chrome/browser/chromeos/gdata/gdata_cache_metadata.cc
index bd1527bce99adaa9c340788ff2462f9a7d1041ce..ffc8b98c005281cb86ad4daf70df3be49596f045 100644
--- a/chrome/browser/chromeos/gdata/gdata_cache_metadata.cc
+++ b/chrome/browser/chromeos/gdata/gdata_cache_metadata.cc
@@ -11,16 +11,6 @@ namespace gdata {
namespace {
-// Changes the permissions of |file_path| to |permissions|.
-bool ChangeFilePermissions(const FilePath& file_path, mode_t permissions) {
- if (HANDLE_EINTR(chmod(file_path.value().c_str(), permissions)) != 0) {
- PLOG(ERROR) << "Error changing permissions of " << file_path.value();
- return false;
- }
- DVLOG(1) << "Changed permissions of " << file_path.value();
- return true;
-}
-
// Returns true if |file_path| is a valid symbolic link as |sub_dir_type|.
// Otherwise, returns false with the reason.
bool IsValidSymbolicLink(const FilePath& file_path,
@@ -139,8 +129,9 @@ void GDataCacheMetadataMap::Initialize(
// Change permissions of cache persistent directory to u+rwx,og+x in order to
// allow archive files in that directory to be mounted by cros-disks.
- if (!ChangeFilePermissions(cache_paths[GDataCache::CACHE_TYPE_PERSISTENT],
- S_IRWXU | S_IXGRP | S_IXOTH))
+ if (!file_util::SetPosixFilePermissions(
+ cache_paths[GDataCache::CACHE_TYPE_PERSISTENT],
+ S_IRWXU | S_IXGRP | S_IXOTH))
return;
DVLOG(1) << "Scanning directories";
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698