CHANGE remove fdson poll error or closed
diff --git a/src/notification_server.c b/src/notification_server.c
index 633936b..1c1f959 100644
--- a/src/notification_server.c
+++ b/src/notification_server.c
@@ -919,9 +919,19 @@
for (n = 0; n < count_pollfds; n++) {
if (pollfds[n].revents & POLLHUP) {
ERROR("notifications: poll pipe closed");
+ if (--count_pollfds) {
+ m = fd_lookup[pa->fd];
+ pollfds[m] = pollfds[count_pollfds];
+ fd_lookup[pollfds[count_pollfds].fd] = m;
+ }
return -1;
} else if (pollfds[n].revents & POLLERR) {
ERROR("notifications: poll pipe error");
+ if (--count_pollfds) {
+ m = fd_lookup[pa->fd];
+ pollfds[m] = pollfds[count_pollfds];
+ fd_lookup[pollfds[count_pollfds].fd] = m;
+ }
return -1;
} else if (pollfds[n].revents & (POLLIN | POLLOUT)) {
/*