diff options
Diffstat (limited to 'src/unix/system.c')
-rw-r--r-- | src/unix/system.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/unix/system.c b/src/unix/system.c index 68e685f..24642a2 100644 --- a/src/unix/system.c +++ b/src/unix/system.c @@ -275,6 +275,7 @@ void *Sys_LoadLibrary(const char *path, const char *sym, void **handle) *handle = NULL; + dlerror(); module = dlopen(path, RTLD_LAZY); if (!module) { Com_SetLastError(dlerror()); @@ -299,7 +300,14 @@ void *Sys_LoadLibrary(const char *path, const char *sym, void **handle) void *Sys_GetProcAddress(void *handle, const char *sym) { - return dlsym(handle, sym); + void *entry; + + dlerror(); + entry = dlsym(handle, sym); + if (!entry) + Com_SetLastError(dlerror()); + + return entry; } /* |