diff --git a/indra/mac_updater/MacUpdaterAppDelegate.mm b/indra/mac_updater/MacUpdaterAppDelegate.mm
index b6f95eef7e11c89e2eb133f63b5f77754cbaa066..4457419a94fb6e3e2c5471e33ca3abc9d35e459b 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 fc9565d63d5093b2bc03ad7baae166c4027089fd..bc9fec355838e32a39456ee176ba9bab33f22921 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 */