chiark
/
gitweb
/
~mdw
/
disorder
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cope with a toxic cookie Ross found under a rock
[disorder]
/
lib
/
plugin.c
diff --git
a/lib/plugin.c
b/lib/plugin.c
index 1c526de937d1a8ed55f2be4b17ad540ec053ebd7..c23865d9f9f3cac377df19e0c0980421d8af7415 100644
(file)
--- a/
lib/plugin.c
+++ b/
lib/plugin.c
@@
-1,6
+1,6
@@
/*
* This file is part of DisOrder.
/*
* This file is part of DisOrder.
- * Copyright (C) 2004
, 2005, 2006
Richard Kettlewell
+ * Copyright (C) 2004
-2008
Richard Kettlewell
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@
-84,22
+84,22
@@
const struct plugin *open_plugin(const char *name,
function_t *get_plugin_function(const struct plugin *pl,
const char *symbol) {
function_t *f;
function_t *get_plugin_function(const struct plugin *pl,
const char *symbol) {
function_t *f;
- const char *e;
f = (function_t *)dlsym(pl->dlhandle, symbol);
f = (function_t *)dlsym(pl->dlhandle, symbol);
- if((e = dlerror()))
- fatal(0, "error looking up function '%s' in '%s': %s",symbol, pl->name, e);
+ if(!f)
+ fatal(0, "error looking up function '%s' in '%s': %s",
+ symbol, pl->name, dlerror());
return f;
}
const void *get_plugin_object(const struct plugin *pl,
const char *symbol) {
void *o;
return f;
}
const void *get_plugin_object(const struct plugin *pl,
const char *symbol) {
void *o;
- const char *e;
o = dlsym(pl->dlhandle, symbol);
o = dlsym(pl->dlhandle, symbol);
- if((e = dlerror()))
- fatal(0, "error looking up object '%s' in '%s': %s", symbol, pl->name, e);
+ if(!o)
+ fatal(0, "error looking up object '%s' in '%s': %s",
+ symbol, pl->name, dlerror());
return o;
}
return o;
}