Re: [hatari-devel] (raw) MIDI connection reliability?

[ Thread Index | Date Index | More Archives ]

Am Sat, 25 Jun 2022 13:40:17 +0300
schrieb Eero Tamminen <oak@xxxxxxxxxxxxxx>:

> Hi,
> On 25.6.2022 10.48, Thomas Huth wrote:
> > Am Sat, 18 Jun 2022 16:19:43 +0300
> > schrieb Eero Tamminen <oak@xxxxxxxxxxxxxx>:  
> >> On 18.6.2022 16.05, Eero Tamminen wrote:  
> >>>> Anyway, since EOF is guaranteed to be negative, it shouldn't
> >>>> really matter much in this case, so never mind, let's just
> >>>> leave the code as it is.  
> >>>
> >>> I think I need to update logging to check errno instead of return value.
> >>>     Now it ignores all errors as they all get mapped to EOF return value.  
> >>
> >> Does attached patch look OK?  I mean, can we trust on errno being set
> >> (glibc fgetc manual does not say anything about errno)...  
> > 
> > I don't think this is ok yet: According to the 3p man page of fgetc, errno
> > only gets set on errors, not on end-of-file conditions, so I think you
> > explicitely have to clear errno first if you want to check it afterwards.  
> Thanks.  With that fixed, does it look good enough to go in for the release?

Should be fine, I guess. In the worst case, we just get bogus error
messages here, right?

> Btw. I forgot to mention results of my debugging yesterday:
> * There were no errors logged (once I disregarded some pre-existing 
> "file not found" errno value).
> * It seemed that MidWiz receiving end tried to read one byte more than 
> was written.  I'm not sure about that though because both ends were 
> hanging though

I assume the problem is not related to the host side, but rather a bug in
the MIDI hardware emulation. Needs more investigation, but I think this
should not block the release since it is not a regression.


Mail converted by MHonArc 2.6.19+