diff options
Diffstat (limited to 'indra/mac_updater')
-rw-r--r-- | indra/mac_updater/CMakeLists.txt | 1 | ||||
-rw-r--r-- | indra/mac_updater/MacUpdaterAppDelegate.mm | 24 | ||||
-rw-r--r-- | indra/mac_updater/mac_updater.cpp | 14 |
3 files changed, 15 insertions, 24 deletions
diff --git a/indra/mac_updater/CMakeLists.txt b/indra/mac_updater/CMakeLists.txt index aa70e64b71..4f39e941a1 100644 --- a/indra/mac_updater/CMakeLists.txt +++ b/indra/mac_updater/CMakeLists.txt @@ -63,6 +63,7 @@ target_link_libraries(mac-updater ${OPENSSL_LIBRARIES} ${CRYPTO_LIBRARIES} ${COCOA_LIBRARIES} + ${BOOST_FILESYSTEM_LIBRARY} ${IOKIT_LIBRARY} ${CURL_LIBRARIES} ${CARES_LIBRARIES} diff --git a/indra/mac_updater/MacUpdaterAppDelegate.mm b/indra/mac_updater/MacUpdaterAppDelegate.mm index 179946a238..3ddf8f9274 100644 --- a/indra/mac_updater/MacUpdaterAppDelegate.mm +++ b/indra/mac_updater/MacUpdaterAppDelegate.mm @@ -124,30 +124,6 @@ void sendProgress(int cur, int max, const std::string str) setProgressText(str); } -bool mkTempDir(boost::filesystem::path& temp_dir) -{ - NSString * tempDir = NSTemporaryDirectory(); - if (tempDir == nil) - tempDir = @"/tmp/"; - - std::string* temp_str = NSToString(tempDir); - *temp_str += std::string("SecondLifeUpdate_XXXXXX"); - - char temp[PATH_MAX] = ""; /* Flawfinder: ignore */ - strncpy(temp, temp_str->c_str(), temp_str->length()); - - if(mkdtemp(temp) == NULL) - { - return false; - } - - temp_dir = boost::filesystem::path(temp); - - delete temp_str; - - return true; -} - bool copyDir(const std::string& src_dir, const std::string& dest_dir) { NSString* file = [NSString stringWithCString:src_dir.c_str() diff --git a/indra/mac_updater/mac_updater.cpp b/indra/mac_updater/mac_updater.cpp index 47fc16769c..34d2b07438 100644 --- a/indra/mac_updater/mac_updater.cpp +++ b/indra/mac_updater/mac_updater.cpp @@ -494,6 +494,20 @@ bool LLMacUpdater::doInstall(const boost::filesystem::path& app_dir, return true; } +bool mkTempDir(boost::filesystem::path& temp_dir) +{ + char temp_str[PATH_MAX] = "/tmp/SecondLifeUpdate_XXXXXX"; + + if(mkdtemp(temp_str) == NULL) + { + return false; + } + + temp_dir = boost::filesystem::path(temp_str); + + return true; +} + void* LLMacUpdater::updatethreadproc(void*) { char tempDir[PATH_MAX] = ""; /* Flawfinder: ignore */ |