diff options
Diffstat (limited to 'src/disp.c')
-rw-r--r-- | src/disp.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -18,12 +18,13 @@ #include <dlfcn.h> #include <string.h> +#include <stdio.h> #include <stdlib.h> #include <assert.h> #include "disp.h" -#define dlsym_and_check(dest, name) \ +#define dlsym_and_check(dest, name) \ dest->name = dlsym(dest->dl_handle, #name); \ if (!dest->name) { \ dlclose(dest->dl_handle); \ @@ -43,7 +44,11 @@ get_disp(char *disp_name) void *handle = dlopen(so_path, RTLD_LAZY); if (!handle) - return NULL; + { + char *msg = dlerror(); + fprintf(stderr, "calculer: %s\n", msg); + exit(1); + } struct disp *disp = malloc(sizeof(*disp)); disp->dl_handle = handle; |