Re: ERANGE strikes again on my Windows build; RFH
From: Michal Suchánek <hidden>
Date: 2020-01-05 15:27:37
From: Michal Suchánek <hidden>
Date: 2020-01-05 15:27:37
On Mon, Dec 30, 2019 at 10:49:48AM -0800, Jonathan Nieder wrote:
Johannes Sixt wrote:quoted
Am 30.12.19 um 19:06 schrieb Jonathan Nieder:quoted
quoted
when errno is meaningful for a function for a given return value, the usual convention is (1) it *always* sets errno for errors, not conditionallyYou 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