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>
diff --git a/file_descriptor.cc b/file_descriptor.cc
index 255307d..f6b55bb 100644
--- a/file_descriptor.cc
+++ b/file_descriptor.cc
@@ -48,7 +48,7 @@
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 2159d28..f5237a2 100644
--- a/omaha_hash_calculator.cc
+++ b/omaha_hash_calculator.cc
@@ -91,7 +91,7 @@
}
bytes_processed += rc;
}
- HANDLE_EINTR(close(fd));
+ IGNORE_EINTR(close(fd));
return bytes_processed;
}
diff --git a/utils.h b/utils.h
index 77ed9d9..2961edf 100644
--- a/utils.h
+++ b/utils.h
@@ -480,7 +480,7 @@
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;
}
}