- avoid extra file creation

This commit is contained in:
dmytro.bogovych 2019-02-14 18:00:50 +02:00
parent 3eacafd1c8
commit 4d7e6dbcb4
1 changed files with 2 additions and 8 deletions

View File

@ -39,14 +39,8 @@ std::string FileHelper::gettempname()
return buffer; return buffer;
#elif defined(TARGET_OSX) #elif defined(TARGET_OSX)
char template_filename[L_tmpnam] = "rtphone_XXXXXXX.tmp"; char template_filename[L_tmpnam] = "rtphone_XXXXXXX.tmp";
int handle = mkstemp(template_filename); mktemp(template_filename);
if (handle != -1)
{
close(handle);
return template_filename; return template_filename;
}
else
return std::string();
#endif #endif
} }