aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Host/common/FileSystem.cpp
diff options
context:
space:
mode:
authorAaron Smith <aaron.smith@microsoft.com>2019-02-07 18:46:25 +0000
committerAaron Smith <aaron.smith@microsoft.com>2019-02-07 18:46:25 +0000
commit3a14249525235d9d2bcbc0e931759d083bcdb0d1 (patch)
tree42fc3fd705c69cbddb24e36ace4dff518d8e6c78 /lldb/source/Host/common/FileSystem.cpp
parent1e6ba236083687e612d6805bd572e4ba16956c86 (diff)
downloadllvm-3a14249525235d9d2bcbc0e931759d083bcdb0d1.zip
llvm-3a14249525235d9d2bcbc0e931759d083bcdb0d1.tar.gz
llvm-3a14249525235d9d2bcbc0e931759d083bcdb0d1.tar.bz2
[lldb-server] Improve support on Windows
Summary: This commit contains the following changes: - Rewrite vfile close/read/write packet handlers with portable routines from lldb. This removes #if(s) and allows the handlers to work on Windows. - Fix a bug in File::Write. This is intended to write data at an offset to a file but actually writes at the current position of the file. - Add a default boolean argument 'should_close_fd' to FileSystem::Open to let the user decide whether to close the fd or not. Reviewers: zturner, llvm-commits, labath Reviewed By: zturner Subscribers: Hui, labath, abidh, lldb-commits Differential Revision: https://reviews.llvm.org/D56231 llvm-svn: 353446
Diffstat (limited to 'lldb/source/Host/common/FileSystem.cpp')
-rw-r--r--lldb/source/Host/common/FileSystem.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/source/Host/common/FileSystem.cpp b/lldb/source/Host/common/FileSystem.cpp
index 6fbd7bc..3315962 100644
--- a/lldb/source/Host/common/FileSystem.cpp
+++ b/lldb/source/Host/common/FileSystem.cpp
@@ -408,7 +408,7 @@ static mode_t GetOpenMode(uint32_t permissions) {
}
Status FileSystem::Open(File &File, const FileSpec &file_spec, uint32_t options,
- uint32_t permissions) {
+ uint32_t permissions, bool should_close_fd) {
if (m_collector)
m_collector->AddFile(file_spec);
@@ -431,7 +431,7 @@ Status FileSystem::Open(File &File, const FileSpec &file_spec, uint32_t options,
File.SetDescriptor(descriptor, false);
error.SetErrorToErrno();
} else {
- File.SetDescriptor(descriptor, true);
+ File.SetDescriptor(descriptor, should_close_fd);
File.SetOptions(options);
}
return error;