From 74d188702c18c3a95a4f0e33381f265037def7ab Mon Sep 17 00:00:00 2001 From: fpetrini15 Date: Fri, 18 Oct 2024 12:09:41 -0700 Subject: [PATCH] Review comments --- src/backend_manager.cc | 2 +- src/shared_library.cc | 4 ++-- src/shared_library.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/backend_manager.cc b/src/backend_manager.cc index 4fd869eff..c4ff0d137 100644 --- a/src/backend_manager.cc +++ b/src/backend_manager.cc @@ -200,7 +200,7 @@ TritonBackend::LoadBackendLibrary( RETURN_IF_ERROR(slib->OpenLibraryHandle(libpath_, &dlhandle_)); - if (!original_path.empty()) { + if (!additional_dependency_dir_path.empty()) { RETURN_IF_ERROR(slib->RemoveAdditionalDependencyDir(original_path)); } diff --git a/src/shared_library.cc b/src/shared_library.cc index c28406487..4df9794bf 100644 --- a/src/shared_library.cc +++ b/src/shared_library.cc @@ -254,7 +254,7 @@ SharedLibrary::AddAdditionalDependencyDir( original_path.resize(len); GetEnvironmentVariableW(PATH.c_str(), &original_path[0], len); } else { - return Status(Status::Code::INTERNAL, "PATH variable is empty"); + original_path = L""; } LOG_VERBOSE(1) << "Environment before extending PATH: " @@ -298,7 +298,7 @@ SharedLibrary::AddAdditionalDependencyDir( } Status -SharedLibrary::RemoveAdditionalDependencyDir(std::wstring& original_path) +SharedLibrary::RemoveAdditionalDependencyDir(const std::wstring& original_path) { #ifdef _WIN32 const std::wstring PATH(L"Path"); diff --git a/src/shared_library.h b/src/shared_library.h index b114b4a7c..fc69f306d 100644 --- a/src/shared_library.h +++ b/src/shared_library.h @@ -71,7 +71,7 @@ class SharedLibrary { // Restore PATH to its original configuration. Should be used in // conjunction with AddAdditionalDependencyDir (Windows-only). - Status RemoveAdditionalDependencyDir(std::wstring& original_path); + Status RemoveAdditionalDependencyDir(const std::wstring& original_path); private: DISALLOW_COPY_AND_ASSIGN(SharedLibrary);