1
1
diff --git a/util/env_windows.cc b/util/env_windows.cc
2
- index 09e3df6..23d60f1 100644
2
+ index 09e3df6..5d9b2f2 100644
3
3
--- a/util/env_windows.cc
4
4
+++ b/util/env_windows.cc
5
5
@@ -362,9 +362,11 @@ class WindowsEnv : public Env {
@@ -118,7 +118,7 @@ index 09e3df6..23d60f1 100644
118
118
DWORD last_error = ::GetLastError();
119
119
::FindClose(dir_handle);
120
120
if (last_error != ERROR_NO_MORE_FILES) {
121
- @@ -482,13 +496,16 @@ class WindowsEnv : public Env {
121
+ @@ -482,21 +496,24 @@ class WindowsEnv : public Env {
122
122
}
123
123
124
124
Status DeleteFile(const std::string& fname) override {
@@ -131,12 +131,12 @@ index 09e3df6..23d60f1 100644
131
131
}
132
132
133
133
Status CreateDir(const std::string& name) override {
134
+ - if (!::CreateDirectoryA(name.c_str(), nullptr)) {
134
135
+ auto wDirname = toUtf16(name);
135
136
+ if (!::CreateDirectoryW(wDirname.c_str(), nullptr)) {
136
- if (!::CreateDirectoryA(name.c_str(), nullptr)) {
137
137
return WindowsError(name, ::GetLastError());
138
138
}
139
- @@ -496,7 +513,8 @@ class WindowsEnv : public Env {
139
+ return Status::OK();
140
140
}
141
141
142
142
Status DeleteDir(const std::string& name) override {
@@ -146,7 +146,7 @@ index 09e3df6..23d60f1 100644
146
146
return WindowsError(name, ::GetLastError());
147
147
}
148
148
return Status::OK();
149
- @@ -504,7 +522 ,9 @@ class WindowsEnv : public Env {
149
+ @@ -504,7 +521 ,9 @@ class WindowsEnv : public Env {
150
150
151
151
Status GetFileSize(const std::string& fname, uint64_t* size) override {
152
152
WIN32_FILE_ATTRIBUTE_DATA attrs;
@@ -157,7 +157,7 @@ index 09e3df6..23d60f1 100644
157
157
return WindowsError(fname, ::GetLastError());
158
158
}
159
159
ULARGE_INTEGER file_size;
160
- @@ -518,7 +538 ,9 @@ class WindowsEnv : public Env {
160
+ @@ -518,7 +537 ,9 @@ class WindowsEnv : public Env {
161
161
const std::string& target) override {
162
162
// Try a simple move first. It will only succeed when |to_path| doesn't
163
163
// already exist.
@@ -168,7 +168,7 @@ index 09e3df6..23d60f1 100644
168
168
return Status::OK();
169
169
}
170
170
DWORD move_error = ::GetLastError();
171
- @@ -527,7 +549 ,7 @@ class WindowsEnv : public Env {
171
+ @@ -527,7 +548 ,7 @@ class WindowsEnv : public Env {
172
172
// succeed when |to_path| does exist. When writing to a network share, we
173
173
// may not be able to change the ACLs. Ignore ACL errors then
174
174
// (REPLACEFILE_IGNORE_MERGE_ERRORS).
@@ -177,7 +177,7 @@ index 09e3df6..23d60f1 100644
177
177
REPLACEFILE_IGNORE_MERGE_ERRORS, nullptr, nullptr)) {
178
178
return Status::OK();
179
179
}
180
- @@ -546,8 +568 ,9 @@ class WindowsEnv : public Env {
180
+ @@ -546,8 +567 ,9 @@ class WindowsEnv : public Env {
181
181
Status LockFile(const std::string& fname, FileLock** lock) override {
182
182
*lock = nullptr;
183
183
Status result;
@@ -189,7 +189,7 @@ index 09e3df6..23d60f1 100644
189
189
/*lpSecurityAttributes=*/nullptr, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL,
190
190
nullptr);
191
191
if (!handle.is_valid()) {
192
- @@ -584,10 +607 ,11 @@ class WindowsEnv : public Env {
192
+ @@ -584,10 +606 ,11 @@ class WindowsEnv : public Env {
193
193
return Status::OK();
194
194
}
195
195
@@ -203,7 +203,7 @@ index 09e3df6..23d60f1 100644
203
203
std::stringstream ss;
204
204
ss << tmp_path << "leveldbtest-" << std::this_thread::get_id();
205
205
*result = ss.str();
206
- @@ -598,7 +622 ,8 @@ class WindowsEnv : public Env {
206
+ @@ -598,7 +621 ,8 @@ class WindowsEnv : public Env {
207
207
}
208
208
209
209
Status NewLogger(const std::string& filename, Logger** result) override {
@@ -213,7 +213,7 @@ index 09e3df6..23d60f1 100644
213
213
if (fp == nullptr) {
214
214
*result = nullptr;
215
215
return WindowsError("NewLogger", ::GetLastError());
216
- @@ -640,6 +665 ,31 @@ class WindowsEnv : public Env {
216
+ @@ -640,6 +664 ,31 @@ class WindowsEnv : public Env {
217
217
bool started_bgthread_;
218
218
std::deque<BGItem> queue_;
219
219
Limiter mmap_limiter_;
0 commit comments