]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/thread.c
Merge pull request #538 from qlyoung/fix-stack-access-2
[mirror_frr.git] / lib / thread.c
index efc0dfb2a476ff1772dd9068412edf856973cdb4..2843a9211ee88f6d1600eb10c0a939bbd40a71f5 100644 (file)
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with GNU Zebra; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.  
+ * You should have received a copy of the GNU General Public License along
+ * with this program; see the file COPYING; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /* #define DEBUG */
@@ -1217,14 +1216,13 @@ check_pollfds(struct thread_master *m, fd_set *readfd, int num)
       ready++;
 
       /* POLLIN / POLLOUT process event */
-      if (m->handler.pfds[i].revents & POLLIN)
+      if (m->handler.pfds[i].revents & (POLLIN | POLLHUP))
         thread_process_fds_helper(m, m->read[m->handler.pfds[i].fd], NULL, POLLIN, i);
       if (m->handler.pfds[i].revents & POLLOUT)
         thread_process_fds_helper(m, m->write[m->handler.pfds[i].fd], NULL, POLLOUT, i);
 
       /* remove fd from list on POLLNVAL */
-      if (m->handler.pfds[i].revents & POLLNVAL ||
-          m->handler.pfds[i].revents & POLLHUP)
+      if (m->handler.pfds[i].revents & POLLNVAL)
         {
            memmove(m->handler.pfds+i,
                    m->handler.pfds+i+1,