From a9e57c70b5d6d856a6f653064cf60f73bbef2df2 Mon Sep 17 00:00:00 2001 From: Ajay Date: Fri, 22 Sep 2023 15:57:24 -0700 Subject: [PATCH] SWDEV-1 - fix build errors for file descriptor Change-Id: I38b3962744f20ce758c32077f2c725013c666a35 [ROCm/clr commit: 3337f6912d7931109d38419bffb345f903d83ae9] --- projects/clr/hipamd/src/hip_fatbin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/clr/hipamd/src/hip_fatbin.cpp b/projects/clr/hipamd/src/hip_fatbin.cpp index c75e9110b9..2a1c1777b4 100644 --- a/projects/clr/hipamd/src/hip_fatbin.cpp +++ b/projects/clr/hipamd/src/hip_fatbin.cpp @@ -53,7 +53,7 @@ FatBinaryInfo::~FatBinaryInfo() { if (!HIP_USE_RUNTIME_UNBUNDLER) { // Using COMGR Unbundler - if (ufd_ && ufd_->fdesc_ > 0) { + if (ufd_ && amd::Os::isValidFileDesc(ufd_->fdesc_)) { // Check for ufd_ != nullptr, since sometimes, we never create unique_file_desc. if (ufd_->fsize_ && image_mapped_ && !amd::Os::MemoryUnmapFile(image_, ufd_->fsize_)) { @@ -282,7 +282,7 @@ hipError_t FatBinaryInfo::ExtractFatBinaryUsingCOMGR(const std::vector 0) { + if (amd::Os::isValidFileDesc(fdesc_)) { guarantee(fsize_ > 0, "Size has to greater than 0 too"); if (!amd::Os::CloseFileHandle(fdesc_)) guarantee(false, "Cannot close the file handle");