diff options
author | Mike Pall <mike> | 2011-11-25 12:25:51 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2011-11-25 12:25:51 +0100 |
commit | 90c445851ffb697adc680c4ffd735d940536cfa5 (patch) | |
tree | 1135bd049b038210b1dd96607cc266d654f507ab /src | |
parent | c2dcf39ee3d113ce775e8e4c10f8f8ea4467f920 (diff) | |
download | luajit-90c445851ffb697adc680c4ffd735d940536cfa5.tar.gz luajit-90c445851ffb697adc680c4ffd735d940536cfa5.tar.bz2 luajit-90c445851ffb697adc680c4ffd735d940536cfa5.zip |
FFI: Fix GetLastError() save/restore around ffi.load().
Diffstat (limited to 'src')
-rw-r--r-- | src/lj_clib.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lj_clib.c b/src/lj_clib.c index 937b1258..ff71346a 100644 --- a/src/lj_clib.c +++ b/src/lj_clib.c | |||
@@ -185,8 +185,8 @@ static void *clib_loadlib(lua_State *L, const char *name, int global) | |||
185 | { | 185 | { |
186 | DWORD oldwerr = GetLastError(); | 186 | DWORD oldwerr = GetLastError(); |
187 | void *h = (void *)LoadLibraryA(clib_extname(L, name)); | 187 | void *h = (void *)LoadLibraryA(clib_extname(L, name)); |
188 | SetLastError(oldwerr); | ||
189 | if (!h) clib_error(L, "cannot load module " LUA_QS ": %s", name); | 188 | if (!h) clib_error(L, "cannot load module " LUA_QS ": %s", name); |
189 | SetLastError(oldwerr); | ||
190 | UNUSED(global); | 190 | UNUSED(global); |
191 | return h; | 191 | return h; |
192 | } | 192 | } |