svn commit: r236582 - head/lib/libc/stdlib

Joerg Sonnenberger joerg at britannica.bec.de
Tue Jun 5 14:25:31 UTC 2012


On Tue, Jun 05, 2012 at 05:13:05PM +0400, Andrey Chernov wrote:
> On Tue, Jun 05, 2012 at 02:55:20PM +0200, Joerg Sonnenberger wrote:
> > On Tue, Jun 05, 2012 at 04:39:01PM +0400, Andrey Chernov wrote:
> > > Moreover, standard metion "unsuccessful call" case for free() where errno 
> > > state is totally undefined.
> > 
> > ...which would be a programming mistake in first place and is valid as
> > justification.
> 
> Not only that (I mean programming mistake in the realpath). F.e. internal 
> free/malloc state can be damaged by other code even earlier. But all of 
> this is not the case, since POSIX allows it to modify errno on _success_,
> which is main reason of the change.
> Please see 
> http://austingroupbugs.net/view.php?id=385

That is about explicitly recognizing how stupid the notion of free(3)
not preserving errno is. Seriously, before you start to randomly bloat
code all over the place, restricting the behavior of free(3) to be
sensible is a much saner option.

Joerg


More information about the svn-src-all mailing list