Fix Settings::OpenForReadingAndWriting using O_CREAT with no mode.

R=mark@chromium.org

Review URL: https://codereview.chromium.org/997613002
This commit is contained in:
Robert Sesek 2015-03-10 13:52:19 -04:00
parent 7979d9db4e
commit e4c8b6cc72
2 changed files with 5 additions and 6 deletions

View File

@ -30,15 +30,15 @@ namespace crashpad {
struct ALIGNAS(4) Settings::Data { struct ALIGNAS(4) Settings::Data {
static const uint16_t kSettingsVersion = 1; static const uint16_t kSettingsVersion = 1;
enum Options : uint32_t {
kUploadsEnabled = 1 << 0,
};
Data() : version(kSettingsVersion), Data() : version(kSettingsVersion),
options(0), options(0),
last_upload_attempt_time(0), last_upload_attempt_time(0),
client_id() {} client_id() {}
enum Options : uint32_t {
kUploadsEnabled = 1 << 0,
};
uint32_t version; uint32_t version;
uint32_t options; uint32_t options;
uint64_t last_upload_attempt_time; // time_t uint64_t last_upload_attempt_time; // time_t
@ -152,7 +152,7 @@ ScopedFileHandle Settings::OpenForReading() {
ScopedFileHandle Settings::OpenForReadingAndWriting() { ScopedFileHandle Settings::OpenForReadingAndWriting() {
ScopedFileHandle handle(HANDLE_EINTR( ScopedFileHandle handle(HANDLE_EINTR(
open(file_path(), O_RDWR | O_EXLOCK | O_CREAT))); open(file_path(), O_RDWR | O_EXLOCK | O_CREAT, 0644)));
PLOG_IF(ERROR, !handle.is_valid()) << "open for writing"; PLOG_IF(ERROR, !handle.is_valid()) << "open for writing";
return handle.Pass(); return handle.Pass();
} }

View File

@ -14,7 +14,6 @@
#include "client/settings.h" #include "client/settings.h"
#include "client/crash_report_database.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "util/file/file_io.h" #include "util/file/file_io.h"
#include "util/test/scoped_temp_dir.h" #include "util/test/scoped_temp_dir.h"