Comparison

util-src/poll.c @ 9478:bd178ed0459b

util.poll: Fix inverted logic
author Kim Alvefur <zash@zash.se>
date Thu, 11 Oct 2018 18:56:11 +0200
parent 9476:f3935aa4cc7e
child 9506:ae6636052be9
comparison
equal deleted inserted replaced
9477:0738f5276e0a 9478:bd178ed0459b
349 * Close epoll FD 349 * Close epoll FD
350 */ 350 */
351 int Lgc(lua_State *L) { 351 int Lgc(lua_State *L) {
352 struct Lpoll_state *state = luaL_checkudata(L, 1, STATE_MT); 352 struct Lpoll_state *state = luaL_checkudata(L, 1, STATE_MT);
353 353
354 if(state->epoll_fd != -1) { 354 if(state->epoll_fd == -1) {
355 return 0; 355 return 0;
356 } 356 }
357 357
358 if(close(state->epoll_fd) == 0) { 358 if(close(state->epoll_fd) == 0) {
359 state->epoll_fd = -1; 359 state->epoll_fd = -1;