macos fixes

This commit is contained in:
2025-08-02 10:55:00 -05:00
parent fdec5f7b6e
commit ad5794c223
2 changed files with 3 additions and 5 deletions

View File

@@ -53,13 +53,11 @@ auto change_to_process_directory() -> bool {
}
#else // !defined(_WIN32)
std::string path;
path.resize(PATH_MAX + 1);
path.resize(repertory::max_path_length + 1);
#if defined(__APPLE__)
auto res = proc_pidpath(getpid(), reinterpret_cast<void *>(path.data()),
static_cast<uint32_t>(path.size()));
if (res == 0) {
path = utils::path::get_parent_path(path);
}
path = path.c_str();
#else // !defined(__APPLE__)
auto res = readlink("/proc/self/exe", path.data(), path.size());
if (res == -1) {