Eli Zaretskii writes: > I think this change should be installed regardless, as it fixes an > oversight. However, I think it needs to be augmented, because the > fact that FILE_CONNECT flag is set doesn't necessarily mean the > connection is in progress: it could have failed already. We need to > look at the status as well. > > The possible states of the FILE_CONNECT flag and the cp->status values > are: > > flag status description > ---------------------------------------------------------------------------- > ON STATUS_READ_READY reader thread is about to try connect > ON STATUS_READ_FAILED reader thread waits in _sys_wait_connect > ON STATUS_READ_SUCCEEDED reader thread successfully connected > ON STATUS_CONNECT_FAILED reader thread failed to connect > OFF STATUS_READ_ACKNOWLEDGED sys_select acknowledged successful connect > OFF STATUS_READ_READY reader thread is about to read > OFF STATUS_READ_IN_PROGRESS reader thread waits in _sys_read_ahead > OFF STATUS_READ_SUCCEEDED reader thread succeeded in reading > OFF STATUS_READ_FAILED reader thread failed to read > > So we should only return EWOULDBLOCK when FILE_CONNECT is set _and_ > the status is not STATUS_CONNECT_FAILED. If FILE_CONNECT is set, but > the status is STATUS_CONNECT_FAILED, we should instead return the > value computed from cp->errcode (if it is non-zero). There's an > example of that in sys_read. Thank you very much for these inputs. I rearranged the patch to include these two cases and removed another special case that should no longer be needed as it is covered by the first one. Is this what you had in mind? Do you agree with the change? Thanks.