This commit is contained in:
Scott E. Graves 2023-12-14 08:58:33 -06:00
parent 67191be78d
commit 3fe5eac56d

View File

@ -40,13 +40,13 @@ auto native_file::clone(const native_file_ptr &ptr) -> native_file_ptr {
#ifdef _WIN32
source_path.resize(MAX_PATH + 1);
::GetFinalPathNameByHandleA(nf->get_handle(), source_path.data(),
::GetFinalPathNameByHandleA(ptr->get_handle(), source_path.data(),
MAX_PATH + 1,
FILE_NAME_NORMALIZED | VOLUME_NAME_DOS);
#else
source_path.resize(PATH_MAX + 1);
#ifdef __APPLE__
fcntl(nf->get_handle(), F_GETPATH, source_path.data());
fcntl(ptr->get_handle(), F_GETPATH, source_path.data());
#else
readlink(("/proc/self/fd/" + std::to_string(ptr->get_handle())).c_str(),
source_path.data(), source_path.size());