- fixes for Android + ongoing migration to latest resiprocate

This commit is contained in:
2023-05-14 12:04:49 +03:00
parent 0eb5ad7cf7
commit dd6c01ca0d
8960 changed files with 133 additions and 2018592 deletions

View File

@@ -1,7 +1,7 @@
#include "HL_File.h"
#include <fstream>
#if defined(TARGET_LINUX) || defined(TARGET_OSX)
#if defined(TARGET_LINUX) || defined(TARGET_OSX) || defined(TARGET_ANDROID)
# include <unistd.h>
# include <sys/statvfs.h>
# include <memory.h>
@@ -34,7 +34,7 @@ void FileHelper::remove(const char* s)
std::string FileHelper::gettempname()
{
#if defined(TARGET_LINUX)
#if defined(TARGET_LINUX) || defined(TARGET_ANDROID)
char template_filename[L_tmpnam] = "rtphone_XXXXXXX.tmp";
mkstemp(template_filename);
return template_filename;
@@ -64,7 +64,7 @@ std::string FileHelper::getCurrentDir()
return std::string();
#endif
#if defined(TARGET_LINUX) || defined(TARGET_OSX)
#if defined(TARGET_LINUX) || defined(TARGET_OSX) || defined(TARGET_ANDROID)
char buf[512];
if (getcwd(buf, sizeof buf) != nullptr)
return buf;

View File

@@ -311,6 +311,8 @@ std::shared_ptr<std::thread> OsProcess::asyncExecCommand(const std::string& cmdl
return t;
}
#if defined(TARGET_OSX) || defined(TARGET_LINUX)
pid_t OsProcess::findPid(const std::string& cmdline)
{
try
@@ -332,5 +334,6 @@ void OsProcess::killByPid(pid_t pid)
return;
execSystem("kill -9 " + std::to_string(pid) + " &");
}
#endif
#endif