emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fix latent bug in process.c


From: Tom Tromey
Subject: Re: fix latent bug in process.c
Date: Tue, 14 Aug 2012 08:45:25 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux)

>>>>> "Andreas" == Andreas Schwab <address@hidden> writes:

Andreas> Tom Tromey <address@hidden> writes:
>> The second part is really the interesting one though.

Andreas> If select can't figure out whether an fd is writable, it must
Andreas> be assumed to be always writable, otherwise it will never be
Andreas> written to.

Ok, thanks.  That makes the first bit make sense.
However, I still don't understand why we'd bother selecting for write
and then ignore the results.  If we're going to do this it seems like we
might as well not pass these bits to select at all.

What do you think of the appended instead?
This should preserve the current behavior if SELECT_CANT_DO_WRITE_MASK;
but properly check the results from select elsewhere.

Tom

        * process.c (wait_reading_process_output): Check Writeok bits,
        not write_mask.

diff --git a/src/process.c b/src/process.c
index 0be624a..18775c5 100644
--- a/src/process.c
+++ b/src/process.c
@@ -4792,7 +4792,7 @@ wait_reading_process_output (intmax_t time_limit, int 
nsecs, int read_kbd,
               && d->func != 0
               && (d->condition & FOR_READ) != 0)
             d->func (channel, d->data, 1);
-          if (FD_ISSET (channel, &write_mask)
+          if (FD_ISSET (channel, &Writeok)
               && d->func != 0
               && (d->condition & FOR_WRITE) != 0)
             d->func (channel, d->data, 0);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]