diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-12 06:07:25 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-12 06:07:25 +0000 |
commit | b266ffea340315ef1cee2c69afe314b545c08d91 (patch) | |
tree | bfaf304ed986ac5490474772ad85a06eb658edf6 /base/platform_file_posix.cc | |
parent | b5d41bf892f31b76ca39da16174d00378996b389 (diff) | |
download | chromium_src-b266ffea340315ef1cee2c69afe314b545c08d91.zip chromium_src-b266ffea340315ef1cee2c69afe314b545c08d91.tar.gz chromium_src-b266ffea340315ef1cee2c69afe314b545c08d91.tar.bz2 |
Fix problems in src/base:
- de-facto ignored return value of PathService::Get in base_paths_mac.mm
- missing EINTR handling in other files
I was just reading the code looking for some issues.
BUG=none
Review URL: http://codereview.chromium.org/6820030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81220 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/platform_file_posix.cc')
-rw-r--r-- | base/platform_file_posix.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/base/platform_file_posix.cc b/base/platform_file_posix.cc index 2a8d2ca..6e2cff6 100644 --- a/base/platform_file_posix.cc +++ b/base/platform_file_posix.cc @@ -66,7 +66,8 @@ PlatformFile CreatePlatformFile(const FilePath& name, int flags, COMPILE_ASSERT(O_RDONLY == 0, O_RDONLY_must_equal_zero); - int descriptor = open(name.value().c_str(), open_flags, S_IRUSR | S_IWUSR); + int descriptor = + HANDLE_EINTR(open(name.value().c_str(), open_flags, S_IRUSR | S_IWUSR)); if (flags & PLATFORM_FILE_OPEN_ALWAYS) { if (descriptor > 0) { @@ -78,7 +79,8 @@ PlatformFile CreatePlatformFile(const FilePath& name, int flags, flags & PLATFORM_FILE_EXCLUSIVE_WRITE) { open_flags |= O_EXCL; // together with O_CREAT implies O_NOFOLLOW } - descriptor = open(name.value().c_str(), open_flags, S_IRUSR | S_IWUSR); + descriptor = HANDLE_EINTR( + open(name.value().c_str(), open_flags, S_IRUSR | S_IWUSR)); if (created && descriptor > 0) *created = true; } @@ -134,7 +136,7 @@ PlatformFile CreatePlatformFile(const FilePath& name, int flags, } bool ClosePlatformFile(PlatformFile file) { - return !close(file); + return !HANDLE_EINTR(close(file)); } int ReadPlatformFile(PlatformFile file, int64 offset, char* data, int size) { @@ -157,7 +159,7 @@ bool TruncatePlatformFile(PlatformFile file, int64 length) { } bool FlushPlatformFile(PlatformFile file) { - return !fsync(file); + return !HANDLE_EINTR(fsync(file)); } bool TouchPlatformFile(PlatformFile file, const base::Time& last_access_time, |