Detailed warnings for 'plugin' command errors

This commit is contained in:
Vladimir Dubrovin 2026-04-10 19:30:22 +03:00
parent 0c8be907e9
commit 825563ad85

View File

@ -1480,9 +1480,15 @@ static int h_plugin(int argc, unsigned char **argv){
#else
void *hi, *fp;
hi = dlopen((char *)argv[1], RTLD_LAZY);
if(!hi) return 1;
if(!hi) {
fprintf(stderr, "%s", dlerror());
return 1;
}
fp = dlsym(hi, (char *)argv[2]);
if(!fp) return 2;
if(!fp) {
fprintf(stderr, "%s", dlerror());
return 2;
}
return (*(PLUGINFUNC)fp)(&pluginlink, argc - 2, (char **)argv + 2);
#endif
#endif