fix regression

This commit is contained in:
Anthony 2024-03-11 00:08:23 +01:00
parent afa6846041
commit 830fa5fbfc

View file

@ -207,6 +207,19 @@ std::string getExecutablePath()
#include <linux/limits.h> // PATH_MAX #include <linux/limits.h> // PATH_MAX
namespace pf
{
std::string getExecutablePath()
{
char result[PATH_MAX];
ssize_t count = readlink("/proc/self/exe", result, PATH_MAX);
const char *path;
if (count != -1) {
path = dirname(result);
}
return path;
}
}
static void throwOnRelative(const char *envName, const char *envValue) static void throwOnRelative(const char *envName, const char *envValue)
{ {
@ -271,18 +284,6 @@ namespace pf
} }
#endif #endif
std::string getExecutablePath()
{
char result[PATH_MAX];
ssize_t count = readlink("/proc/self/exe", result, PATH_MAX);
const char *path;
if (count != -1) {
path = dirname(result);
}
return path;
}
std::string getDataHome() std::string getDataHome()
{ {
#ifdef _WIN32 #ifdef _WIN32