Re: [Bug-tar] Error "Cannot allocate memory" incorrectly reported in some cases.

2005-10-29 Thread Paul Eggert
"Sergey Poznyakoff" <[EMAIL PROTECTED]> writes: > OK, I just thought, however, that readdir itself is not required > to preserve the value of errno in case of succesful return. That's correct. It must preserve errno only if it returns NULL at the end of the directory. > In general, it seems a b

Re: [Bug-tar] Error "Cannot allocate memory" incorrectly reported in some cases.

2005-10-29 Thread Paul Eggert
"Dmitry V. Levin" <[EMAIL PROTECTED]> writes: > if errno is used to test for readdir() errors like in this example, > then errno should be cleared before each readdir() call, not just > before first one. Yes, and the patch I installed yesterday to savedir.c does just that. > Similar issue exists

Re: [Bug-tar] Error "Cannot allocate memory" incorrectly reported in some cases.

2005-10-29 Thread Joerg Schilling
"Sergey Poznyakoff" <[EMAIL PROTECTED]> wrote: > Paul Eggert <[EMAIL PROTECTED]> 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. > > O

Re: [Bug-tar] Error "Cannot allocate memory" incorrectly reported in some cases.

2005-10-29 Thread Sergey Poznyakoff
Joerg Schilling <[EMAIL PROTECTED]> wrote: > If you look at errno values, there must be a strange bug in GNU tar. In gnulib, to be precise. > Why should a preserved errno be relevent in case the high level function > does not fail? In my opinion, it should not. Regards, Sergey _

Re: [Bug-tar] Error "Cannot allocate memory" incorrectly reported in some cases.

2005-10-29 Thread Sergey Poznyakoff
Paul Eggert <[EMAIL PROTECTED]> 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 require