From 42d3022b00d62a27b9f3820b84032b92ac0b0363 Mon Sep 17 00:00:00 2001 From: Jan D Date: Sun, 26 Sep 2010 17:39:10 +0200 Subject: [PATCH] * xgselect.c (xg_select): Clear file descriptors not set from rfds and wfds. --- src/ChangeLog | 5 +++++ src/xgselect.c | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 36e1fbab2bf..435c09f0ff8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2010-09-26 Jan Djärv + + * xgselect.c (xg_select): Clear file descriptors not set from + rfds and wfds. + 2010-09-21 Stefan Monnier * syntax.c (back_comment): Detect the case where a 1-char comment diff --git a/src/xgselect.c b/src/xgselect.c index d93c1bdf405..a06713458a0 100644 --- a/src/xgselect.c +++ b/src/xgselect.c @@ -113,11 +113,17 @@ xg_select (max_fds, rfds, wfds, efds, timeout) if (rfds && FD_ISSET (i, rfds)) ++retval; else ++our_fds; } + else if (rfds) + FD_CLR (i, rfds); + if (have_wfds && FD_ISSET (i, &all_wfds)) { if (wfds && FD_ISSET (i, wfds)) ++retval; else ++our_fds; } + else if (wfds) + FD_CLR (i, wfds); + if (efds && FD_ISSET (i, efds)) ++retval; } -- 2.39.2