[PATCH 2/5] libdl: dlerror return NULL when no error

Chris Johns chrisj at rtems.org
Thu Feb 8 03:25:08 UTC 2018


From: Patrick Gauvin <gauvin at hcs.ufl.edu>

Updates #2747
---
 cpukit/libdl/dlfcn.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/cpukit/libdl/dlfcn.c b/cpukit/libdl/dlfcn.c
index 4277caf757..55ad97b753 100644
--- a/cpukit/libdl/dlfcn.c
+++ b/cpukit/libdl/dlfcn.c
@@ -132,6 +132,8 @@ dlerror (void)
   static char msg[64];
   rtems_rtl_get_error (msg, sizeof (msg));
   rtems_rtl_clear_error ();
+  if (msg[0] == '\0')
+    return NULL;
   return msg;
 }
 
-- 
2.14.1




More information about the devel mailing list