diff options
author | Mike Frysinger <vapier@chromium.org> | 2014-05-14 16:28:23 -0400 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-05-15 23:52:53 +0000 |
commit | bcee2ca34ebcd3b0abc7bc611370d323e55fa62c (patch) | |
tree | b5a991b4af0fcb74173dc50a1026e84e4693d7eb | |
parent | a03a6910f2bad3bcdcc3eb5a8140bb607854f2fe (diff) |
use IGNORE_EINTR w/close
HANDLE_EINTR is both not safe and not useful on Linux systems.
Switch to IGNORE_EINTR like Chromium has done everywhere.
See http://crbug.com/269623 for details.
BUG=chromium:373154
TEST=`cbuildbot {arm,amd64,x86}-generic-full` passes
Change-Id: Ia2ee7db803366f1305919c4c40c2709e62faae20
Reviewed-on: https://chromium-review.googlesource.com/199823
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
-rw-r--r-- | file_descriptor.cc | 2 | ||||
-rw-r--r-- | omaha_hash_calculator.cc | 2 | ||||
-rw-r--r-- | utils.h | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/file_descriptor.cc b/file_descriptor.cc index 255307d3..f6b55bb7 100644 --- a/file_descriptor.cc +++ b/file_descriptor.cc @@ -48,7 +48,7 @@ ssize_t EintrSafeFileDescriptor::Write(const void* buf, size_t count) { bool EintrSafeFileDescriptor::Close() { CHECK_GE(fd_, 0); - if (HANDLE_EINTR(close(fd_))) + if (IGNORE_EINTR(close(fd_))) return false; Reset(); return true; diff --git a/omaha_hash_calculator.cc b/omaha_hash_calculator.cc index 2159d281..f5237a21 100644 --- a/omaha_hash_calculator.cc +++ b/omaha_hash_calculator.cc @@ -91,7 +91,7 @@ off_t OmahaHashCalculator::UpdateFile(const string& name, off_t length) { } bytes_processed += rc; } - HANDLE_EINTR(close(fd)); + IGNORE_EINTR(close(fd)); return bytes_processed; } @@ -480,7 +480,7 @@ class ScopedEintrSafeFdCloser { explicit ScopedEintrSafeFdCloser(int* fd) : fd_(fd), should_close_(true) {} ~ScopedEintrSafeFdCloser() { if (should_close_ && fd_ && (*fd_ >= 0)) { - if (!HANDLE_EINTR(close(*fd_))) + if (!IGNORE_EINTR(close(*fd_))) *fd_ = -1; } } |