From 20bcc7dfab7dd434e233e3a3c7c9d8945d087a65 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Tue, 29 Oct 2024 14:23:24 +0100 Subject: [PATCH] Print dlopen error on stderr Otherwise a package that happens to try to load opencl to get information (e.g. hwloc-calc) would spuriously emit output that disturbs further processing, e.g.: $ N=$(hwloc-calc all -N node) $ echo "$N" dlerror: libamd_comgr.so.2: cannot open shared object file: No such file or directory 2 --- opencl/khronos/icd/loader/linux/icd_linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opencl/khronos/icd/loader/linux/icd_linux.c b/opencl/khronos/icd/loader/linux/icd_linux.c index 11693ecfd0..7dfcfec5be 100644 --- a/opencl/khronos/icd/loader/linux/icd_linux.c +++ b/opencl/khronos/icd/loader/linux/icd_linux.c @@ -175,7 +175,7 @@ void *khrIcdOsLibraryLoad(const char *libraryName) void *retVal = dlopen (libraryName, RTLD_NOW); if (NULL == retVal) { - printf("dlerror: %s\n", dlerror()); + fprintf(stderr, "dlerror: %s\n", dlerror()); } return retVal;