This commit is contained in:
Justin Ethier 2017-03-22 18:38:34 -04:00
parent a93c1e8cde
commit a63fb1b1c7
2 changed files with 11 additions and 2 deletions

View file

@ -5603,9 +5603,18 @@ void Cyc_import_shared_object(void *data, object cont, object filename, object e
Cyc_check_str(data, entry_pt_fnc);
handle = dlopen(string_str(filename), RTLD_LAZY);
if (handle == NULL) {
Cyc_rt_raise2(data, "Unable to import library from", filename);
//make_string(s, dlerror());
fprintf(stderr, "%s\n", dlerror());
Cyc_rt_raise2(data, "Unable to import library", filename);
}
dlerror(); /* Clear any existing error */
entry_pt = (function_type) dlsym(handle, string_str(entry_pt_fnc));
if (entry_pt == NULL) {
//make_string(s, dlerror());
fprintf(stderr, "%s\n", dlerror());
Cyc_rt_raise2(data, "Unable to load symbol", entry_pt_fnc);
}
mclosure1(clo, entry_pt, cont);
entry_pt(data, 0, &clo, &clo);
}