diff options
author | Pavel Labath <labath@google.com> | 2017-01-25 11:10:52 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2017-01-25 11:10:52 +0000 |
commit | 2d0c5b02970da62dd10baab1d197535f0d3c16ac (patch) | |
tree | 5e5eeb6da482d25556fb357f9b44f389a80d31ef /lldb/source/Plugins/Process/gdb-remote | |
parent | 9694376a93653b4303e41895262f8b427fcd392e (diff) | |
download | bcm5719-llvm-2d0c5b02970da62dd10baab1d197535f0d3c16ac.tar.gz bcm5719-llvm-2d0c5b02970da62dd10baab1d197535f0d3c16ac.zip |
Replace chdir() usage with the llvm equivalent.
This removes a hack in PosixApi.h, which tends to produce strange
compile errors when it's included in the wrong order.
llvm-svn: 293045
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp index d3161838ed3..66d1345b434 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp @@ -353,8 +353,6 @@ GDBRemoteCommunicationServerPlatform::Handle_qProcessInfo( GDBRemoteCommunication::PacketResult GDBRemoteCommunicationServerPlatform::Handle_qGetWorkingDir( StringExtractorGDBRemote &packet) { - // If this packet is sent to a platform, then change the current working - // directory llvm::SmallString<64> cwd; if (std::error_code ec = llvm::sys::fs::current_path(cwd)) @@ -372,10 +370,8 @@ GDBRemoteCommunicationServerPlatform::Handle_QSetWorkingDir( std::string path; packet.GetHexByteString(path); - // If this packet is sent to a platform, then change the current working - // directory - if (::chdir(path.c_str()) != 0) - return SendErrorResponse(errno); + if (std::error_code ec = llvm::sys::fs::set_current_path(path)) + return SendErrorResponse(ec.value()); return SendOKResponse(); } |