git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: ERANGE strikes again on my Windows build; RFH

From
Michal Suchánek <msuchanek@suse.de>
Date
Jan 5, 2020, 15:27 UTC
Message-ID
<20200105152732.GR4113@kitsune.suse.cz>
In-Reply-To
<20191230184948.GC57251@google.com>
On Mon, Dec 30, 2019 at 10:49:48AM -0800, Jonathan Nieder wrote:
Show 16 quoted lines
> Johannes Sixt wrote:
> > Am 30.12.19 um 19:06 schrieb Jonathan Nieder:
> 
> >>                                                                    when
> >> errno is meaningful for a function for a given return value, the usual
> >> convention is
> >>
> >>  (1) it *always* sets errno for errors, not conditionally
> >
> > You seem to understand that errno isn't set somewhere where it should be
> > set.
> 
> On the contrary: this caller is using errno as an error *indicator*
> instead of a way of *distinguishing* between errors (or to put it
> another way, this caller is treating `errno == 0` as a meaningful
> condition).  This means the calling code is buggy.

That works completely fine if the code in question also sets errno to 0 in case there is some other leftover value from a previous library call.

Thanks
Michal
Previous: Jonathan Nieder
Message 10 of 10 in “ERANGE strikes again on my Windows build; RFH”
  1. Johannes SixtDec 28, 2019
  2. Torsten BögershausenDec 29, 2019
  3. Andreas SchwabDec 29, 2019
  4. Alban GruinDec 29, 2019
  5. Johannes SixtDec 29, 2019
  6. Junio C HamanoDec 30, 2019
  7. Jonathan NiederDec 30, 2019
  8. Johannes SixtDec 30, 2019
  9. Jonathan NiederDec 30, 2019
  10. Michal SuchánekJan 5, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.