From 8149afd0910854c66ecde42584ee84063274bdda Mon Sep 17 00:00:00 2001 From: Robert Knight Date: Mon, 22 Aug 2011 14:44:16 +0100 Subject: [PATCH] Implement ProcessUtils::currentProcessPath() on Mac This allows the basic updater unit test to pass. --- src/ProcessUtils.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ProcessUtils.cpp b/src/ProcessUtils.cpp index e77f947..f4449a5 100644 --- a/src/ProcessUtils.cpp +++ b/src/ProcessUtils.cpp @@ -19,6 +19,7 @@ #ifdef PLATFORM_MAC #include +#include #endif int ProcessUtils::runSync(const std::string& executable, @@ -293,6 +294,13 @@ std::string ProcessUtils::currentProcessPath() std::string path = FileOps::canonicalPath("/proc/self/exe"); LOG(Info,"Current process path " + path); return path; +#elif defined(PLATFORM_MAC) + uint32_t bufferSize = PATH_MAX; + char buffer[bufferSize]; + _NSGetExecutablePath(buffer,&bufferSize); + return buffer; +#else + return std::string(); #endif }