diff options
-rw-r--r-- | base/file_util.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/base/file_util.h b/base/file_util.h index 467b404..a129876 100644 --- a/base/file_util.h +++ b/base/file_util.h @@ -33,6 +33,7 @@ #include "base/time.h" #if defined(OS_POSIX) +#include "base/eintr_wrapper.h" #include "base/file_descriptor_posix.h" #endif @@ -348,8 +349,8 @@ typedef scoped_ptr_malloc<FILE, ScopedFILEClose> ScopedFILE; class ScopedFDClose { public: inline void operator()(int* x) const { - if (x) { - close(*x); + if (x && *x >= 0) { + HANDLE_EINTR(close(*x)); } } }; |