moonbridge

changeset 239:90e6db450677

merge
author jbe
date Sat Aug 20 21:56:30 2016 +0200 (2016-08-20)
parents 1fd00eed96ee 73d832c4a9b5
children 05fab92f20e9
files moonbridge_io.c
line diff
     1.1 --- a/moonbridge_io.c	Sat Aug 20 21:54:15 2016 +0200
     1.2 +++ b/moonbridge_io.c	Sat Aug 20 21:56:30 2016 +0200
     1.3 @@ -790,8 +790,7 @@
     1.4    handle->fd = *fd;  /* required for set_linger call */
     1.5    moonbr_io_handle_set_linger(L, handle, 0);
     1.6    handle->fd = -1;  /* avoid closing incomplete handle */
     1.7 -  luaL_getmetatable(L, MOONBR_IO_HANDLE_MT_REGKEY);
     1.8 -  lua_setmetatable(L, -2);
     1.9 +  luaL_setmetatable(L, MOONBR_IO_HANDLE_MT_REGKEY);
    1.10    lua_newtable(L);  // uservalue
    1.11    lua_newtable(L);
    1.12    lua_setfield(L, -2, "writequeue");
    1.13 @@ -875,8 +874,7 @@
    1.14      lua_pushinteger(L, ntohs(addr_in.sin_port));
    1.15      lua_setfield(L, -2, "remote_tcpport");
    1.16    }
    1.17 -  luaL_getmetatable(L, MOONBR_IO_HANDLE_PUBLIC_MT_REGKEY);
    1.18 -  lua_setmetatable(L, -2);
    1.19 +  luaL_setmetatable(L, MOONBR_IO_HANDLE_PUBLIC_MT_REGKEY);
    1.20    lua_setfield(L, -2, "public");
    1.21    lua_setuservalue(L, -2);
    1.22    handle->fd = *fd;
    1.23 @@ -1286,8 +1284,7 @@
    1.24    child->pid = 0;
    1.25    lua_newtable(L);
    1.26    lua_setuservalue(L, -2);
    1.27 -  luaL_getmetatable(L, MOONBR_IO_CHILD_MT_REGKEY);
    1.28 -  lua_setmetatable(L, -2);
    1.29 +  luaL_setmetatable(L, MOONBR_IO_CHILD_MT_REGKEY);
    1.30    if (socketpair(PF_LOCAL, SOCK_STREAM | SOCK_CLOEXEC, 0, sockin)) {
    1.31      moonbr_io_errmsg();
    1.32      lua_pushnil(L);

Impressum / About Us