Index: platform.cc |
diff --git a/platform.cc b/platform.cc |
index 4229cee4648d7172d539f25c68dad9764ecfbb05..7d0f935fd45c2e95302061a4e61d9f4fdaac2896 100644 |
--- a/platform.cc |
+++ b/platform.cc |
@@ -386,6 +386,15 @@ bool Platform::SetOwnershipRecursive(const std::string& directory, |
return true; |
} |
+bool Platform::SetPermissions(const std::string& path, mode_t new_perms) { |
+ if (chmod(path.c_str(), new_perms)) { |
+ PLOG(ERROR) << "chmod() of " << path.c_str() << " to " << new_perms |
+ << " failed."; |
+ return false; |
+ } |
+ return true; |
+} |
+ |
int Platform::SetMask(int new_mask) { |
return umask(new_mask); |
} |