Re: [hatari-devel] (raw) MIDI connection reliability? |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] (raw) MIDI connection reliability?
- From: Thomas Huth <th.huth@xxxxxxxxx>
- Date: Sat, 25 Jun 2022 07:48:51 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1656143334; bh=Oc7YIvhKLWFqDLYTJjTgnsZngiy1KAGSYJ7RC2cb2Eg=; h=Date:From:To:Subject:From; b=K70X27XFlz4M2aB7lWGvEL1ImGmAp/2uVlrtD2SSmWekqCD8xOzJgoEiWT0/isxAL LLpAbBGna3eHYRrdkyMUhRTEYSSB2ZuurcakJC92C7rOgQryhTB+5U9ERtO8LmeXR2 K0MCbKp2izkfVItV6/dgO7F3QJmyV1i1h0rzvN6mnlfZCu70kg/I2S+/ZYmZ2P8pym 7YU0NF1ZNZRzmqAdgaDiQYxOzPSxQ6U1Z1FYsN6VUWGlr/XjSHsCurV1eOkv1md2GO Sqy3KutyN9qHIw9EOg+RXo5rXAd3L4lKWl2guSi3DzCAE7uLSFRsPEQVcJe8BDKH82 e/poEmbPZw89g==
Am Sat, 18 Jun 2022 16:19:43 +0300
schrieb Eero Tamminen <oak@xxxxxxxxxxxxxx>:
> Hi,
>
> 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.
Thomas