]> code.delx.au - gnu-emacs/commitdiff
Remove callback-handled channels from Available set
authorTassilo Horn <tsdh@gnu.org>
Tue, 22 Sep 2015 05:43:39 +0000 (07:43 +0200)
committerTassilo Horn <tsdh@gnu.org>
Tue, 22 Sep 2015 05:43:39 +0000 (07:43 +0200)
* src/process.c (wait_reading_process_output): Remove channel from
Available set if it is handled by a callback, e.g., dbus or
inotify (bug#21313).

src/process.c

index 55f31a0267347201d3d3b0cd4f0d8f9b1e77413f..73704c03ee71988f5991ccec1caa346b73b37c78 100644 (file)
@@ -5036,7 +5036,10 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
                   && FD_ISSET (channel, &Available))
                  || (d->condition & FOR_WRITE
                      && FD_ISSET (channel, &write_mask))))
-            d->func (channel, d->data);
+           {
+             d->func (channel, d->data);
+             FD_CLR (channel, &Available);
+           }
        }
 
       for (channel = 0; channel <= max_process_desc; channel++)