MINOR: fd: Don't forget to reset fdtab[fd].update when a fd is added/removed
It used to be guaranteed by the polling functions on a later call but
with concurrent accesses it cannot be granted anymore.
diff --git a/include/proto/fd.h b/include/proto/fd.h
index 1efe323..38c12b6 100644
--- a/include/proto/fd.h
+++ b/include/proto/fd.h
@@ -338,6 +338,7 @@
{
fdtab[fd].ev = 0;
fdtab[fd].new = 1;
+ fdtab[fd].updated = 0;
fdtab[fd].linger_risk = 0;
fdtab[fd].cloned = 0;
if (fd + 1 > maxfd)
diff --git a/src/fd.c b/src/fd.c
index 1a62f9a..c197557 100644
--- a/src/fd.c
+++ b/src/fd.c
@@ -190,10 +190,11 @@
port_range_release_port(fdinfo[fd].port_range, fdinfo[fd].local_port);
fdinfo[fd].port_range = NULL;
- if (do_close)
- close(fd);
fdtab[fd].owner = NULL;
+ fdtab[fd].updated = 0;
fdtab[fd].new = 0;
+ if (do_close)
+ close(fd);
while ((maxfd-1 >= 0) && !fdtab[maxfd-1].owner)
maxfd--;