FFI: Fix GetLastError() save/restore around ffi.load().

This commit is contained in:
Mike Pall 2011-11-25 12:25:51 +01:00
parent c2dcf39ee3
commit 90c445851f

View File

@ -185,8 +185,8 @@ static void *clib_loadlib(lua_State *L, const char *name, int global)
{
DWORD oldwerr = GetLastError();
void *h = (void *)LoadLibraryA(clib_extname(L, name));
SetLastError(oldwerr);
if (!h) clib_error(L, "cannot load module " LUA_QS ": %s", name);
SetLastError(oldwerr);
UNUSED(global);
return h;
}