| 86 | #include <errno.h> |
| 87 | |
| 88 | static int luaL_fileresult(lua_State *L, int stat, const char *fname) { |
| 89 | int en = errno; |
| 90 | if (stat) return lua_pushboolean(L, 1), 1; |
| 91 | lua_pushnil(L); |
| 92 | lua_pushfstring(L, "%s: %s", fname, strerror(en)); |
| 93 | /*if (fname) lua_pushfstring(L, "%s: %s", fname, strerror(en)); |
| 94 | else lua_pushstring(L, strerror(en));*//* NOT USED */ |
| 95 | lua_pushinteger(L, en); |
| 96 | return 3; |
| 97 | } |
| 98 | |
| 99 | #endif /* not LuaJIT */ |
| 100 |
no test coverage detected