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) {