summaryrefslogtreecommitdiff
path: root/tools/lldb-mi/MIUtilSystemWindows.cpp
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2015-07-03 16:57:06 +0000
committerEd Maste <emaste@FreeBSD.org>2015-07-03 16:57:06 +0000
commit5e95aa85bb660d45e9905ef1d7180b2678280660 (patch)
tree3c2e41c3be19b7fc7666ed45a5f91ec3b6e35f2a /tools/lldb-mi/MIUtilSystemWindows.cpp
parent12bd4897ff0678fa663e09d78ebc22dd255ceb86 (diff)
Notes
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 f03fa225cd908..19c6e9eb979f6 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 )