obscurestar avatar obscurestar committed b634dec Draft

Switched mkTempDir back to using apple standard tempdir behavior instead of /tmp

Comments (0)

Files changed (2)

indra/mac_updater/MacUpdaterAppDelegate.mm

     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];

indra/mac_updater/mac_updater.cpp

     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 */
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.