aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/disp.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/disp.c b/src/disp.c
index f3448ae..6710f40 100644
--- a/src/disp.c
+++ b/src/disp.c
@@ -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;