aboutsummaryrefslogtreecommitdiffstats
path: root/util-src
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-10-12 03:20:09 +0200
committerKim Alvefur <zash@zash.se>2018-10-12 03:20:09 +0200
commit56c2772487be14a1dde2d2da7929725d8035f5fb (patch)
tree4571d78b3e61ea7756150d06476858aa67cc8aa3 /util-src
parentcb124b41ceb043e29f6866c213c1a5af0b0e3b9e (diff)
downloadprosody-56c2772487be14a1dde2d2da7929725d8035f5fb.tar.gz
prosody-56c2772487be14a1dde2d2da7929725d8035f5fb.zip
net.server_epoll: Graceful handling of registering already added socket
Diffstat (limited to 'util-src')
-rw-r--r--util-src/poll.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/util-src/poll.c b/util-src/poll.c
index 7fd28524..58f29041 100644
--- a/util-src/poll.c
+++ b/util-src/poll.c
@@ -452,10 +452,16 @@ int luaopen_util_poll(lua_State *L) {
#endif
}
- lua_createtable(L, 0, 1);
+ lua_createtable(L, 0, 2);
{
lua_pushcfunction(L, Lnew);
lua_setfield(L, -2, "new");
+
+#define push_errno(named_error) lua_pushinteger(L, named_error);\
+ lua_setfield(L, -2, #named_error);
+
+ push_errno(EEXIST);
+
}
return 1;
}