Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(353)

Unified Diff: base/files/scoped_file.cc

Issue 2090703002: Include close errnos in crash dumps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: no such thing as PCHECK_EQ Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/files/scoped_file.cc
diff --git a/base/files/scoped_file.cc b/base/files/scoped_file.cc
index 8971280776c6c946ec7d0b80d2cf4b2b84b208e6..8ce45b8ba39e5a09ec835bdbc3fd72f735788f4b 100644
--- a/base/files/scoped_file.cc
+++ b/base/files/scoped_file.cc
@@ -8,8 +8,10 @@
#include "build/build_config.h"
#if defined(OS_POSIX)
+#include <errno.h>
#include <unistd.h>
+#include "base/debug/alias.h"
#include "base/posix/eintr_wrapper.h"
#endif
@@ -27,7 +29,15 @@ void ScopedFDCloseTraits::Free(int fd) {
// Chrome relies on being able to "drop" such access.
// It's especially problematic on Linux with the setuid sandbox, where
// a single open directory would bypass the entire security model.
- PCHECK(0 == IGNORE_EINTR(close(fd)));
+ int ret = IGNORE_EINTR(close(fd));
+
+ // TODO(davidben): Remove this once it's been determined whether
+ // https://crbug.com/603354 is caused by EBADF or a network filesystem
+ // returning some other error.
+ int close_errno = errno;
+ base::debug::Alias(&close_errno);
+
+ PCHECK(0 == ret);
}
#endif // OS_POSIX
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698