summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2012-12-19 16:52:35 -0500
committerOz Linden <oz@lindenlab.com>2012-12-19 16:52:35 -0500
commit173213b986f7acb200960ee9870d3b036dddcfc7 (patch)
tree715267143deaed69e8e44678f71238e7707fe6ec /indra
parent769336a72ef819b45bfabcb8608f70c9396f58ae (diff)
parent213be712b26119832ccc9f04a17c9013792b5044 (diff)
merge changes for DRTVWR-270
Diffstat (limited to 'indra')
-rw-r--r--indra/mac_updater/MacUpdaterAppDelegate.mm23
-rw-r--r--indra/mac_updater/mac_updater.cpp14
2 files changed, 23 insertions, 14 deletions
diff --git a/indra/mac_updater/MacUpdaterAppDelegate.mm b/indra/mac_updater/MacUpdaterAppDelegate.mm
index b6f95eef7e..4457419a94 100644
--- a/indra/mac_updater/MacUpdaterAppDelegate.mm
+++ b/indra/mac_updater/MacUpdaterAppDelegate.mm
@@ -124,6 +124,29 @@ 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");
+
+ std::cout << "tempDir is " << temp_str << std::endl;
+
+ 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);
+
+ return true;
+}
bool copyDir(const std::string& src_dir, const std::string& dest_dir)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
diff --git a/indra/mac_updater/mac_updater.cpp b/indra/mac_updater/mac_updater.cpp
index fc9565d63d..bc9fec3558 100644
--- a/indra/mac_updater/mac_updater.cpp
+++ b/indra/mac_updater/mac_updater.cpp
@@ -494,20 +494,6 @@ 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 */