| Index: base/files/file_util_posix.cc
|
| diff --git a/base/files/file_util_posix.cc b/base/files/file_util_posix.cc
|
| index 5a94cef661319e39b98ea10037113371b4a2d2ac..7bbdfc5b7c35f2266b3f0819ff1700ca331e9241 100644
|
| --- a/base/files/file_util_posix.cc
|
| +++ b/base/files/file_util_posix.cc
|
| @@ -693,6 +693,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;
|
|
|