# HG changeset patch # User Kim Alvefur # Date 1539276604 -7200 # Node ID 9b26a50cdfe3a9431488b93135855001d23fedd9 # Parent 619ba78709a580b3e6c0d3b787442add78ef0bd5 util.poll: Early return from __gc in case of no valid epoll FD This could happen if the epoll FD has already been closed or the epoll_create call failed diff -r 619ba78709a5 -r 9b26a50cdfe3 util-src/poll.c --- a/util-src/poll.c Thu Oct 11 17:01:45 2018 +0200 +++ b/util-src/poll.c Thu Oct 11 18:50:04 2018 +0200 @@ -351,6 +351,10 @@ int Lgc(lua_State *L) { struct Lpoll_state *state = luaL_checkudata(L, 1, STATE_MT); + if(state->epoll_fd != -1) { + return 0; + } + if(close(state->epoll_fd) == 0) { state->epoll_fd = -1; }