From de7fc458e99867b6cb540ec033c3b740a1dd65e9 Mon Sep 17 00:00:00 2001 From: Tassilo Horn Date: Sat, 3 Oct 2015 06:01:42 +0200 Subject: [PATCH] Revert my two recent process.c changes Revert "Improve last commit to process.c" and "Remove callback-handled channels from Available set" because they did not fix bug#21313. This reverts commits bfa1aa8e2bdaf14adbbf1e9e824051d3f740694c and 27f871907cc24f33a7d12ac3a4ab71a88f0bc554.. --- src/process.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/process.c b/src/process.c index 42dd17c57e0..55f31a02673 100644 --- a/src/process.c +++ b/src/process.c @@ -5031,18 +5031,12 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, for (channel = 0; channel <= max_input_desc; ++channel) { struct fd_callback_data *d = &fd_callback_info[channel]; - if (d->func) - { - if (d->condition & FOR_READ - && FD_ISSET (channel, &Available)) - { - d->func (channel, d->data); - FD_CLR (channel, &Available); - } - else if (d->condition & FOR_WRITE - && FD_ISSET (channel, &write_mask)) - d->func (channel, d->data); - } + if (d->func + && ((d->condition & FOR_READ + && FD_ISSET (channel, &Available)) + || (d->condition & FOR_WRITE + && FD_ISSET (channel, &write_mask)))) + d->func (channel, d->data); } for (channel = 0; channel <= max_process_desc; channel++) -- 2.39.2