blob: d8a1436dd5c5d432fa8bc231161f7fed1cc259b5 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
diff -ruN src-orig/cpluginloader.cpp src/cpluginloader.cpp
--- src-orig/cpluginloader.cpp Fri Oct 1 15:19:44 2004
+++ src/cpluginloader.cpp Thu Oct 12 17:16:22 2006
@@ -40,6 +40,12 @@
*/
bool nPlugin::cPluginLoader::Open()
{
+ /*
+ * Reset dlerror() since it can contain error from previous
+ * call to dlopen()/dlsym().
+ */
+ dlerror();
+
mHandle = dlopen(mFileName.c_str(), RTLD_NOW);
if(!mHandle || IsError()) // NOTE hte OR (||) operator evaluates only the first statement if that one is true
{
@@ -99,6 +105,12 @@
*/
void * nPlugin::cPluginLoader::LoadSym(const char *name)
{
+ /*
+ * Reset dlerror() since it can contain error from previous
+ * call to dlopen()/dlsym().
+ */
+ dlerror();
+
void *func = dlsym( mHandle, name);
if(IsError())
{
diff -ruN src-orig/tpluginbase.cpp src/tpluginbase.cpp
--- src-orig/tpluginbase.cpp Fri Oct 1 15:19:44 2004
+++ src/tpluginbase.cpp Thu Oct 12 17:16:39 2006
@@ -34,6 +34,12 @@
*/
bool nPlugin::tPluginBase::Open()
{
+ /*
+ * Reset dlerror() since it can contain error from previous
+ * call to dlopen()/dlsym().
+ */
+ dlerror();
+
mHandle = dlopen(mFileName.c_str(), RTLD_NOW);
if(!mHandle)
{
|