Displaying 1 result from an estimated 1 matches for "lua_gettable".
2018 Jan 22
2
[PATCH] lua, perl: Use thread-safe strerror_r instead of strerror (RHBZ#1536763).
...+ return luaL_error (L, \"Guestfs.create: cannot create handle: %%s\", err);
+ }
guestfs_set_error_handler (g, NULL, NULL);
@@ -226,6 +230,7 @@ error__tostring (lua_State *L)
{
int code;
const char *msg;
+ char err[128];
lua_pushliteral (L, \"code\");
lua_gettable (L, 1);
@@ -234,8 +239,10 @@ error__tostring (lua_State *L)
lua_gettable (L, 1);
msg = luaL_checkstring (L, -1);
- if (code)
- lua_pushfstring (L, \"%%s: %%s\", msg, strerror (code));
+ if (code) {
+ ignore_value (strerror_r (code, err, sizeof err));
+ lua_pushfstring (...