This is an automated email from the ASF dual-hosted git repository.

astitcher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git


The following commit(s) were added to refs/heads/master by this push:
     new cae6093  PROTON-2228: pn_listener_close doesn't correctly close the 
listener fds
cae6093 is described below

commit cae609301e09ab6bf2fe1c60e8178e864f1539ff
Author: Andrew Stitcher <astitc...@apache.org>
AuthorDate: Fri May 22 03:10:54 2020 -0400

    PROTON-2228: pn_listener_close doesn't correctly close the listener fds
---
 c/src/proactor/epoll.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/c/src/proactor/epoll.c b/c/src/proactor/epoll.c
index 6ae9660..20376e4 100644
--- a/c/src/proactor/epoll.c
+++ b/c/src/proactor/epoll.c
@@ -1779,9 +1779,9 @@ static void listener_begin_close(pn_listener_t* l) {
         if (a->armed) {
           shutdown(ps->epoll_io.fd, SHUT_RD);  // Force epoll event and 
callback
         } else {
+          int fd = ps->epoll_io.fd;
           stop_polling(&ps->epoll_io, ps->proactor->epollfd);
-          close(ps->epoll_io.fd);
-          ps->epoll_io.fd = -1;
+          close(fd);
           l->active_count--;
         }
       }
@@ -1864,9 +1864,9 @@ static pn_event_batch_t *listener_process(pn_listener_t 
*l, int n_events, bool w
         ps->working_io_events = 0;
         if (l->context.closing) {
           l->acceptors[i].armed = false;
+          int fd = ps->epoll_io.fd;
           stop_polling(&ps->epoll_io, ps->proactor->epollfd);
-          close(ps->epoll_io.fd);
-          ps->epoll_io.fd = -1;
+          close(fd);
           l->active_count--;
         } else {
           l->acceptors[i].armed = false;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org

Reply via email to