MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / pushresult

Function pushresult

deps/lua/src/liolib.c:30–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28
29
30static int pushresult (lua_State *L, int i, const char *filename) {
31 int en = errno; /* calls to Lua API may change this value */
32 if (i) {
33 lua_pushboolean(L, 1);
34 return 1;
35 }
36 else {
37 lua_pushnil(L);
38 if (filename)
39 lua_pushfstring(L, "%s: %s", filename, strerror(en));
40 else
41 lua_pushfstring(L, "%s", strerror(en));
42 lua_pushinteger(L, en);
43 return 3;
44 }
45}
46
47
48static void fileerror (lua_State *L, int arg, const char *filename) {

Callers 11

io_pcloseFunction · 0.85
io_fcloseFunction · 0.85
io_openFunction · 0.85
io_popenFunction · 0.85
io_tmpfileFunction · 0.85
g_readFunction · 0.85
g_writeFunction · 0.85
f_seekFunction · 0.85
f_setvbufFunction · 0.85
io_flushFunction · 0.85
f_flushFunction · 0.85

Calls 4

lua_pushbooleanFunction · 0.85
lua_pushnilFunction · 0.85
lua_pushfstringFunction · 0.85
lua_pushintegerFunction · 0.85

Tested by

no test coverage detected