summaryrefslogtreecommitdiffstats
path: root/base/file_util.h
diff options
context:
space:
mode:
authormark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-05 18:41:58 +0000
committermark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-05 18:41:58 +0000
commitb6ee69d9a8b4dfbfabc102eb34b6f2b78b79fffe (patch)
tree3c0a95a7117bad3760a2cd77a1a17cee03d2619f /base/file_util.h
parent5b84a98f6572628008f0b332c7dd1ced676621ba (diff)
downloadchromium_src-b6ee69d9a8b4dfbfabc102eb34b6f2b78b79fffe.zip
chromium_src-b6ee69d9a8b4dfbfabc102eb34b6f2b78b79fffe.tar.gz
chromium_src-b6ee69d9a8b4dfbfabc102eb34b6f2b78b79fffe.tar.bz2
ScopedFD should handle EINTR on close.
BUG=none TEST=none Review URL: http://codereview.chromium.org/1954003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46467 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util.h')
-rw-r--r--base/file_util.h5
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));
}
}
};