Skip to content

Commit df0af38

Browse files
author
sergei
authored
[NFC][SYCL] Fix static analysis warning (#5933)
Signed-off-by: Sergey Kanaev <sergey.kanaev@intel.com>
1 parent dabdbd4 commit df0af38

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sycl/source/detail/posix_pi.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ void *loadOsLibrary(const std::string &PluginPath) {
2222
// RTLD_DEEPBIND option when there are multiple plugins.
2323
void *so = dlopen(PluginPath.c_str(), RTLD_NOW);
2424
if (!so && trace(TraceLevel::PI_TRACE_ALL)) {
25+
char *Error = dlerror();
2526
std::cerr << "SYCL_PI_TRACE[-1]: dlopen(" << PluginPath << ") failed with <"
26-
<< dlerror() << ">" << std::endl;
27+
<< (Error ? Error : "unknown error") << ">" << std::endl;
2728
}
2829
return so;
2930
}

0 commit comments

Comments
 (0)