diff options
author | Aura Linden <aura@lindenlab.com> | 2012-12-11 16:01:35 -0800 |
---|---|---|
committer | Aura Linden <aura@lindenlab.com> | 2012-12-11 16:01:35 -0800 |
commit | e85e6ca4104df14b0bb2d625d82578c81430d28e (patch) | |
tree | 533a7ef96345e04dc32ccebff9a453f00fca845d /indra/mac_updater | |
parent | 6b059d183b9516f45e775bde00f255cef8aab7c0 (diff) | |
parent | a334f41f8ebec5ef812334e5086e54256e2bf7df (diff) |
Merged from viewer-release
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 */ |