[email protected], le ven. 29 août 2025 16:04:38 +0200, a ecrit:
> Aug 28, 2025, 20:50 by [email protected]:
>
> > [email protected], le mar. 26 août 2025 12:33:44 +0200, a ecrit:
> >
> >> Hello Samuel,
> >>
> >> Something like this fixes the D_WOULD_BLOCK errno for me.
> >> --8<---------------cut here---------------start------------->8---
> >> diff --git a/trans/streamio.c b/trans/streamio.c
> >> index e42ff908..93057146 100644
> >> --- a/trans/streamio.c
> >> +++ b/trans/streamio.c
> >> @@ -1049,6 +1049,8 @@ device_read_reply_inband (mach_port_t reply,
> >> kern_return_t errorcode,
> >>
> >> input_pending = 0;
> >> err = errorcode;
> >> + if (err == D_WOULD_BLOCK)
> >> + err = EWOULDBLOCK;
> >>
> >
> > Don't we rather want to set it to 0?
> >
> > If we leave err non-0, the rest of the function will call dev_close. I
> > don't think we want to close the file just on a D_WOULD_BLOCK
> > notification?
> > But it's not an error, it just tells that there is currently nothing to
> > read. If nowait is 0, we still want to enter the wait loop.
> >
> This makes a lot more sense.
> What about this?
Yep, applied, thanks!
> --8<---------------cut here---------------start------------->8---
> diff --git a/trans/streamio.c b/trans/streamio.c
> index e42ff908..c6e7229e 100644
> --- a/trans/streamio.c
> +++ b/trans/streamio.c
> @@ -1049,9 +1049,11 @@ device_read_reply_inband (mach_port_t reply,
> kern_return_t errorcode,
>
> input_pending = 0;
> err = errorcode;
> + if (err == D_WOULD_BLOCK)
> + err = 0;
> if (!err)
> {
> - if (datalen == 0)
> + if (datalen == 0 && errorcode != D_WOULD_BLOCK)
> {
> eof = 1;
> dev_close ();
> --8<---------------cut here---------------end--------------->8---