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 <[email protected]>
> 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().
Life is easier if gethttp has an &errnosv parameter.
Andries