bug-gnulib
[Top][All Lists]
Advanced

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

Re: [Bug-tar] Error "Cannot allocate memory" incorrectly reported in som


From: Joerg Schilling
Subject: Re: [Bug-tar] Error "Cannot allocate memory" incorrectly reported in some cases.
Date: Sat, 29 Oct 2005 12:56:11 +0200
User-agent: nail 11.2 8/15/04

"Sergey Poznyakoff" <address@hidden> wrote:

> Paul Eggert <address@hidden> wrote:
>
> > Thanks for the diagnosis, but the fix isn't quite right in general,
> > since the C standard says memcpy can set errno as well.
> > 
> > I installed this patch instead, both in gnulib and coreutils.
>
> OK, I just thought, however, that readdir itself is not required
> to preserve the value of errno in case of succesful return. In general,
> it seems a bad idea to check errno without knowing which call might
> have changed it.

If you look at errno values, there must be a strange bug in GNU tar.
Note that in the relevent situation, it should only be important whether
a malloc() return value is NULL or not.

Why should a preserved errno be relevent in case the high level function 
does not fail?

Jörg

-- 
 EMail:address@hidden (home) Jörg Schilling D-13353 Berlin
       address@hidden           (uni)  
       address@hidden   (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily




reply via email to

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