aboutsummaryrefslogtreecommitdiff
path: root/tools/lldb-mi/MIUtilSystemWindows.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lldb-mi/MIUtilSystemWindows.cpp')
-rw-r--r--tools/lldb-mi/MIUtilSystemWindows.cpp26
1 files changed, 7 insertions, 19 deletions
diff --git a/tools/lldb-mi/MIUtilSystemWindows.cpp b/tools/lldb-mi/MIUtilSystemWindows.cpp
index f03fa225cd90..19c6e9eb979f 100644
--- a/tools/lldb-mi/MIUtilSystemWindows.cpp
+++ b/tools/lldb-mi/MIUtilSystemWindows.cpp
@@ -7,18 +7,6 @@
//
//===----------------------------------------------------------------------===//
-//++
-// File: MIUtilSystemWindows.cpp
-//
-// Overview: CMIUtilSystemWindows implementation.
-//
-// Environment: Compilers: Visual C++ 12.
-// gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-// Libraries: See MIReadmetxt.
-//
-// Copyright: None.
-//--
-
#if defined(_MSC_VER)
// Third party headers
@@ -29,6 +17,7 @@
// In-house headers:
#include "MIUtilSystemWindows.h"
#include "MICmnResources.h"
+#include "MIUtilFileStd.h"
//++ ------------------------------------------------------------------------------------
// Details: CMIUtilSystemWindows constructor.
@@ -122,15 +111,13 @@ CMIUtilSystemWindows::GetExecutablesPath(CMIUtilString &vrwFileNamePath) const
bool bOk = MIstatus::success;
HMODULE hModule = ::GetModuleHandle(nullptr);
char pPath[MAX_PATH];
- const DWORD nLen = ::GetModuleFileName(hModule, &pPath[0], MAX_PATH);
- const CMIUtilString strLastErr(GetOSLastError());
- if ((nLen != 0) && (strLastErr == "Unknown OS error"))
- vrwFileNamePath = &pPath[0];
- else
+ if (!::GetModuleFileName(hModule, &pPath[0], MAX_PATH))
{
bOk = MIstatus::failure;
- vrwFileNamePath = strLastErr;
+ vrwFileNamePath = GetOSLastError();
}
+ else
+ vrwFileNamePath = &pPath[0];
return bOk;
}
@@ -147,7 +134,8 @@ CMIUtilSystemWindows::GetExecutablesPath(CMIUtilString &vrwFileNamePath) const
bool
CMIUtilSystemWindows::GetLogFilesPath(CMIUtilString &vrwFileNamePath) const
{
- return GetExecutablesPath(vrwFileNamePath);
+ vrwFileNamePath = CMIUtilString(".");
+ return MIstatus::success;
}
#endif // #if defined( _MSC_VER )