Re: [PATCH 3/7] read_in_full: reset errno before reading
- From
Jeff King <peff@peff.net>
- Date
- Sep 26, 2017, 00:19 UTC
- Message-ID
- <20170926001956.hgtdeklogvkirdxa@sigill.intra.peff.net>
- In-Reply-To
- <20170926001732.GP27425@aiede.mtv.corp.google.com>
On Mon, Sep 25, 2017 at 05:17:32PM -0700, Jonathan Nieder wrote:
Show 30 quoted lines
> Jonathan Nieder wrote: > > On Mon, Sep 25, 2017 at 08:09:13PM -0400, Jeff King wrote: > > >> ENODATA is not too bad. On my glibc system it yields "No data available" > >> from strerror(), which is at least comprehensible. > >> > >> We're still left with the question of whether it is defined everywhere > >> (and what to fallback to when it isn't). > > > > So, > > > > #ifndef EUNDERFLOW > > #ifdef ENODATA > > #define ENODATA EUNDERFLOW > > #else > > #define ENODATA ESPIPE > > #endif > > #endif > > > > ? > > Uh, pretend I said > > #ifndef EUNDERFLOW > # ifdef ENODATA > # define EUNDERFLOW ENODATA > # else > # define EUNDERFLOW ESPIPE > # endif > #endif
Right, I think our mails just crossed but I'm leaning in this direction. I'd prefer to call it SHORT_READ_ERRNO or something, though. Your "#ifndef EUNDERFLOW" had me thinking that this was something that a real platform might have, but AFAICT you just made it up.
-Peff