bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Confusing "Success" error message


From: Tim Rühsen
Subject: Re: Confusing "Success" error message
Date: Fri, 8 Nov 2019 15:50:43 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0


On 11/8/19 3:03 PM, Andries E. Brouwer wrote:
> On Fri, Nov 08, 2019 at 09:55:48AM +0100, Tim Rühsen wrote:
>> On 11/8/19 12:03 AM, Andries E. Brouwer wrote:
> 
>>> The hope is probably that errno is the errno from gethttp.
>>> But does time() preserve errno?
>>> And does datetime_str() preserve errno?
>>> It calls fmttime() which calls localtime() and strftime().
>>
>> Libc functions only touch errno if there *is* an error
> 
> Libc functions are free to call other functions internally,
> and such internal calls may fail where the outer level call
> does not fail. So even if a libc function does not return
> an error, errno can have changed.
> If it is needed later, errno should be saved immediately after a
> failing system call.
> 
> In this particular case I see
> 
> % man localtime
> ERRORS
>        EOVERFLOW
>               The result cannot be represented.
> 
> so under unusual circumstances datetime_str() can change errno.

Sure it does - but never to 0 (Success). And that is what the OP is
reporting.

Regards, Tim

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]