Add macOS support #34
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
This commit is contained in:
@@ -55,7 +55,7 @@ auto change_to_process_directory() -> bool {
|
||||
std::string path;
|
||||
path.resize(PATH_MAX + 1);
|
||||
#if defined(__APPLE__)
|
||||
proc_pidpath(getpid(), reinterpret_cast<void *>(path.data()),
|
||||
auto res =proc_pidpath(getpid(), reinterpret_cast<void *>(path.data()),
|
||||
static_cast<uint32_t>(path.size()));
|
||||
#else // !defined(__APPLE__)
|
||||
auto res = readlink("/proc/self/exe", path.data(), path.size());
|
||||
@@ -69,7 +69,7 @@ auto change_to_process_directory() -> bool {
|
||||
}
|
||||
#endif // defined(__APPLE__)
|
||||
path = utils::path::get_parent_path(path);
|
||||
auto res = chdir(path.c_str());
|
||||
res = chdir(path.c_str());
|
||||
if (res != 0) {
|
||||
throw utils::error::create_exception(
|
||||
function_name, {
|
||||
|
@@ -31,6 +31,7 @@ auto convert_to_uint64(pthread_t thread) -> std::uint64_t {
|
||||
#else // defined(__APPLE__)
|
||||
return static_cast<std::uint64_t>(thread);
|
||||
#endif // defined(__APPLE__)
|
||||
}
|
||||
|
||||
auto get_last_error_code() -> int { return errno; }
|
||||
|
||||
|
Reference in New Issue
Block a user