This commit is contained in:
ValKmjolnir
2022-03-01 14:36:05 +08:00
parent 3fac8aa665
commit f312250d27
4 changed files with 91 additions and 26 deletions
+2 -2
View File
@@ -949,7 +949,7 @@ nasal_ref builtin_opendir(nasal_ref* local,nasal_gc& gc)
return builtin_err("opendir","\"path\" must be string");
DIR* p=opendir(path.str()->c_str());
if(!p)
return builtin_err("opendir","cannot open dir <"+*path.str()+">");
return builtin_err("opendir","cannot open dir <"+*path.str()+"> errno "+std::to_string(errno));
nasal_ref ret=gc.alloc(vm_obj);
ret.obj()->type=obj_dir;
ret.obj()->ptr=(void*)p;
@@ -1020,7 +1020,7 @@ nasal_ref builtin_dlopen(nasal_ref* local,nasal_gc& gc)
void* ptr=dlopen(dlname.str()->c_str(),RTLD_LOCAL|RTLD_LAZY);
#endif
if(!ptr)
return builtin_err("dlopen","cannot open dynamic lib \""+*dlname.str()+"\"");
return builtin_err("dlopen","cannot open dynamic lib <"+*dlname.str()+">");
nasal_ref ret=gc.alloc(vm_obj);
ret.obj()->type=obj_dylib;
ret.obj()->ptr=ptr;