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

Unified Diff: third_party/leveldatabase/env_chromium.cc

Issue 23681009: Record errno for SyncParent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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: third_party/leveldatabase/env_chromium.cc
diff --git a/third_party/leveldatabase/env_chromium.cc b/third_party/leveldatabase/env_chromium.cc
index 0333380fd2f3e6ac0dff4318b52eda1b0445144c..97f6c8ef4c16aeba8a7da11230dc8bee85111c04 100644
--- a/third_party/leveldatabase/env_chromium.cc
+++ b/third_party/leveldatabase/env_chromium.cc
@@ -452,10 +452,15 @@ Status ChromiumWritableFile::SyncParent() {
int parent_fd =
HANDLE_EINTR(open(parent_dir_.c_str(), O_RDONLY));
- if (parent_fd < 0)
- return MakeIOError(parent_dir_, strerror(errno), kSyncParent);
+ if (parent_fd < 0) {
+ int saved_errno = errno;
+ return MakeIOError(
+ parent_dir_, strerror(saved_errno), kSyncParent, saved_errno);
+ }
if (HANDLE_EINTR(fsync(parent_fd)) != 0) {
- s = MakeIOError(parent_dir_, strerror(errno), kSyncParent);
+ int saved_errno = errno;
+ s = MakeIOError(
+ parent_dir_, strerror(saved_errno), kSyncParent, saved_errno);
};
HANDLE_EINTR(close(parent_fd));
#endif
« 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