diff options
author | Lua Team <team@lua.org> | 2006-02-07 12:00:00 +0000 |
---|---|---|
committer | repogen <> | 2006-02-07 12:00:00 +0000 |
commit | 43fb64048e381a76d6cd363dedd9ccc8a85b9b31 (patch) | |
tree | 98ca9eb0375499f20a4ca13d2cbbc4451f6e9477 /src/loslib.c | |
parent | b487a3dce43e449acf3852ec56345e2860cfeab7 (diff) | |
download | lua-github-5.1-rc3.tar.gz |
Lua 5.1-rc35.1-rc3
Diffstat (limited to 'src/loslib.c')
-rw-r--r-- | src/loslib.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/loslib.c b/src/loslib.c index 235377e4..509d7b72 100644 --- a/src/loslib.c +++ b/src/loslib.c @@ -1,5 +1,5 @@ /* -** $Id: loslib.c,v 1.16 2005/12/22 16:19:56 roberto Exp $ +** $Id: loslib.c,v 1.17 2006/01/27 13:54:31 roberto Exp $ ** Standard Operating System library ** See Copyright Notice in lua.h */ @@ -21,6 +21,7 @@ static int os_pushresult (lua_State *L, int i, const char *filename) { + int en = errno; /* calls to Lua API may change this value */ if (i) { lua_pushboolean(L, 1); return 1; @@ -28,10 +29,10 @@ static int os_pushresult (lua_State *L, int i, const char *filename) { else { lua_pushnil(L); if (filename) - lua_pushfstring(L, "%s: %s", filename, strerror(errno)); + lua_pushfstring(L, "%s: %s", filename, strerror(en)); else - lua_pushfstring(L, "%s", strerror(errno)); - lua_pushinteger(L, errno); + lua_pushfstring(L, "%s", strerror(en)); + lua_pushinteger(L, en); return 3; } } |