Verified Commit 9d233840 authored by Nala Ginrut's avatar Nala Ginrut
Browse files

Fix bug in exists-in-epoll?

parent 53f09a15
;; -*- indent-tabs-mode:nil; coding: utf-8 -*-
;; Copyright (C) 2016,2017,2018
;; Copyright (C) 2016,2017,2018,2020
;; "Mu Lei" known as "NalaGinrut" <NalaGinrut@gmail.com>
;; Artanis is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License and GNU
......@@ -205,7 +205,7 @@
(lambda (ret errno)
(cond
((zero? ret) ret)
(check-exists?
((and (= op EPOLL_CTL_ADD) check-exists?)
(DEBUG "The event ~a exist and kept alive~%" fd)
(= ret EEXIST))
(else
......@@ -217,7 +217,8 @@
(define-public (exists-in-epoll? epfd fd)
(let* ((ees (make-epoll-event-set))
(ret (epoll-ctl epfd EPOLL_CTL_ADD fd ees #:check-exists? #t)))
(epoll-ctl epfd EPOLL_CTL_DEL fd #f)
(when ret
(epoll-ctl epfd EPOLL_CTL_DEL fd #f))
ret))
;; NOTE: do NOT use this function outside this module!!!
......
;; -*- indent-tabs-mode:nil; coding: utf-8 -*-
;; Copyright (C) 2016,2017,2018,2019
;; Copyright (C) 2016,2017,2018,2019,2020
;; "Mu Lei" known as "NalaGinrut" <NalaGinrut@gmail.com>
;; Artanis is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License and GNU
......@@ -243,7 +243,7 @@
(DEBUG "Restore working client ~a~%" e)
client))))
((exists-in-epoll? (ragnarok-server-epfd server) (car e))
(DEBUG "The fd ~a in still in epoll but not task for it, just ignore!~%"
(DEBUG "The fd ~a in still in epoll but no task for it, just ignore!~%"
(car e))
(close (car e))
#f)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment