[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-tar] Error "Cannot allocate memory" incorrectly reported in som
Re: [Bug-tar] Error "Cannot allocate memory" incorrectly reported in some cases.
Sat, 29 Oct 2005 18:38:20 -0700
Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)
"Sergey Poznyakoff" <address@hidden> 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 bad idea to check errno without knowing which
> call might have changed it.
Yes and no. The current savedir propagates failure back to its
caller. The caller doesn't know which system call set errno, but the
errno value that is propagated is the one that corresponds to the
failing system call. As far as savedir's caller is concerned, it's
savedir that failed.
Or perhaps I'm misunderstanding your point? Anyway, I don't see any
but in the current savedir with respect to errno handling.