summaryrefslogtreecommitdiff
path: root/src/plugger.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2007-01-30 22:40:07 +0000
committerMike Buland <eichlan@xagasoft.com>2007-01-30 22:40:07 +0000
commite82431fb4f5155220c8c0d3f7d11c6d60ab475a4 (patch)
treea8d63bdb73fdb6aa280f7b4f4441d48a23fe0884 /src/plugger.h
parent45c86417cbac76159918e1429a391e2eb510bc32 (diff)
downloadlibbu++-e82431fb4f5155220c8c0d3f7d11c6d60ab475a4.tar.gz
libbu++-e82431fb4f5155220c8c0d3f7d11c6d60ab475a4.tar.bz2
libbu++-e82431fb4f5155220c8c0d3f7d11c6d60ab475a4.tar.xz
libbu++-e82431fb4f5155220c8c0d3f7d11c6d60ab475a4.zip
Hey, Plugger doesn't kill your program with exit, it just throws an exception.
Diffstat (limited to '')
-rw-r--r--src/plugger.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/plugger.h b/src/plugger.h
index b531fae..ee7594a 100644
--- a/src/plugger.h
+++ b/src/plugger.h
@@ -6,6 +6,7 @@
6#include "hashfunctionstring.h" 6#include "hashfunctionstring.h"
7#include "hashfunctionint.h" 7#include "hashfunctionint.h"
8#include "dlfcn.h" 8#include "dlfcn.h"
9#include "exceptions.h"
9 10
10typedef struct PluginInfo 11typedef struct PluginInfo
11{ 12{
@@ -130,14 +131,12 @@ public:
130 pReg->dlHandle = dlopen( sFName, RTLD_NOW ); 131 pReg->dlHandle = dlopen( sFName, RTLD_NOW );
131 if( pReg->dlHandle == NULL ) 132 if( pReg->dlHandle == NULL )
132 { 133 {
133 printf("***ERROR: %s\n\n", dlerror() ); 134 throw PluginException( 1, "Error on %s: %s", sFName, dlerror() );
134 exit( 105 );
135 } 135 }
136 pReg->pInfo = (PluginInfo *)dlsym( pReg->dlHandle, sPluginName ); 136 pReg->pInfo = (PluginInfo *)dlsym( pReg->dlHandle, sPluginName );
137 if( pReg->pInfo == NULL ) 137 if( pReg->pInfo == NULL )
138 { 138 {
139 printf("***ERROR: %s\n\n", dlerror() ); 139 throw PluginException( 2, "Error on %s: %s", sFName, dlerror() );
140 exit( 106 );
141 } 140 }
142 hPlugin.insert( pReg->pInfo->sID, pReg ); 141 hPlugin.insert( pReg->pInfo->sID, pReg );
143 lPlugin.insert( lPlugin.end(), pReg ); 142 lPlugin.insert( lPlugin.end(), pReg );