]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve last commit to process.c
authorTassilo Horn <tsdh@gnu.org>
Tue, 22 Sep 2015 08:19:25 +0000 (10:19 +0200)
committerTassilo Horn <tsdh@gnu.org>
Tue, 22 Sep 2015 08:20:17 +0000 (10:20 +0200)
src/process.c

index 73704c03ee71988f5991ccec1caa346b73b37c78..42dd17c57e07990368cc75eba869c74d95bc6f25 100644 (file)
@@ -5031,14 +5031,17 @@ 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
-             && ((d->condition & FOR_READ
-                  && FD_ISSET (channel, &Available))
-                 || (d->condition & FOR_WRITE
-                     && FD_ISSET (channel, &write_mask))))
+          if (d->func)
            {
-             d->func (channel, d->data);
-             FD_CLR (channel, &Available);
+             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);
            }
        }