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 09:55:48 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0

On 11/8/19 12:03 AM, Andries E. Brouwer wrote:
> On Thu, Nov 07, 2019 at 09:43:00PM +0100, Tim Rühsen wrote:
> 
>> This commit should have fixed it:
>>
>> commit 3056617e9cf9a2c68989a2ff4e4266f6e7a4de45
>> Author: Tim Rühsen <address@hidden>
>> Date:   Wed Feb 10 15:23:13 2016 +0100
>>
>>     Retain value of errno in logprintf()
>>
>>     * src/log.c (logprintf): Save&Restore value of errno
> 
> Usually it is inconvenient to save and restore errno all the time.
> I read
> 
>       err = gethttp (u, original_url, &hstat, dt, proxy, iri, count);
>       tms = datetime_str (time (NULL));
>       if (hstat.newloc)
>         *newloc = xstrdup (hstat.newloc);
>       switch (err) {
>       ... use errno ...
> 
> 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 (else it's very
likely a bug in libc).

So the question is: who is setting errno explicitly to 0 (between the
error and the the usage of errno).

The code works here with glibc 2.29. I need more info on which
OS/system/environment it doesn't work to reproduce and to track it down.
Until then I can't do much but guess.

Regards, Tim

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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