Index: base/file_descriptor_shuffle.cc |
diff --git a/base/file_descriptor_shuffle.cc b/base/file_descriptor_shuffle.cc |
index 1426155a271fce41418299deaca95fcc1788df0e..2b6afd196db0f159d7f5422865acc7f43b3a6a69 100644 |
--- a/base/file_descriptor_shuffle.cc |
+++ b/base/file_descriptor_shuffle.cc |
@@ -7,6 +7,7 @@ |
#include <errno.h> |
#include <unistd.h> |
+#include "base/eintr_wrappers.h" |
#include "base/logging.h" |
namespace base { |
@@ -64,29 +65,16 @@ bool PerformInjectiveMultimap(const InjectiveMultimap& m_in, |
} |
bool FileDescriptorTableInjection::Duplicate(int* result, int fd) { |
- do { |
- *result = dup(fd); |
- } while(*result == -1 && errno == EINTR); |
- |
+ *result = HANDLE_EINTR(dup(fd)); |
return *result >= 0; |
} |
bool FileDescriptorTableInjection::Move(int src, int dest) { |
- int result; |
- |
- do { |
- result = dup2(src, dest); |
- } while (result == -1 && errno == EINTR); |
- |
- return result != -1; |
+ return HANDLE_EINTR(dup2(src, dest)) != -1; |
} |
void FileDescriptorTableInjection::Close(int fd) { |
- int result; |
- |
- do { |
- result = close(fd); |
- } while (result == -1 && errno == EINTR); |
+ HANDLE_EINTR(close(fd)); |
} |
} // namespace base |