| 11942 | |
| 11943 | |
| 11944 | static int pushresult (lua_State *L, int i, const char *filename) { |
| 11945 | int en = errno; /* calls to Lua API may change this value */ |
| 11946 | if (i) { |
| 11947 | lua_pushboolean(L, 1); |
| 11948 | return 1; |
| 11949 | } |
| 11950 | else { |
| 11951 | lua_pushnil(L); |
| 11952 | if (filename) |
| 11953 | lua_pushfstring(L, "%s: %s", filename, strerror(en)); |
| 11954 | else |
| 11955 | lua_pushfstring(L, "%s", strerror(en)); |
| 11956 | lua_pushinteger(L, en); |
| 11957 | return 3; |
| 11958 | } |
| 11959 | } |
| 11960 | |
| 11961 | |
| 11962 | static void fileerror (lua_State *L, int arg, const char *filename) { |
no test coverage detected