| Index: base/files/file_util_posix.cc
|
| diff --git a/base/files/file_util_posix.cc b/base/files/file_util_posix.cc
|
| index d86d9bcc7e94f2067b35ae74855d55a4d1bee290..1494c6a5f26d86a92ba76ffe8d988f4365459745 100644
|
| --- a/base/files/file_util_posix.cc
|
| +++ b/base/files/file_util_posix.cc
|
| @@ -695,6 +695,15 @@ int WriteFile(const FilePath& filename, const char* data, int size) {
|
| return bytes_written;
|
| }
|
|
|
| +bool WriteFileWithMode(const FilePath& filename, const char* data, int size,
|
| + mode_t mode) {
|
| + ThreadRestrictions::AssertIOAllowed();
|
| + ScopedFD file(HANDLE_EINTR(creat(filename.value().c_str(), mode)));
|
| + if (!file.is_valid())
|
| + return false;
|
| + return WriteFileDescriptor(file.get(), data, size);
|
| +}
|
| +
|
| bool WriteFileDescriptor(const int fd, const char* data, int size) {
|
| // Allow for partial writes.
|
| ssize_t bytes_written_total = 0;
|
|
|