[ovs-dev] [PATCH] Avoid implementation-defined strerror behaviour

Ben Pfaff blp at nicira.com
Fri Jul 27 21:33:16 UTC 2012


On Fri, Jul 27, 2012 at 05:27:15PM -0400, Ed Maste wrote:
> POSIX states that the string returned by strerror() may be overwritten
> by a subsequent call (i.e., because it returns a pointer to a static
> buffer).  Make a copy of one of the two strerror() strings to avoid
> this.
> 
> Background: FreeBSD historically returned such a pointer only in the
> case of an invalid errno.  With the addition of NLS strerror was changed
> to do so for all calls.
> 
> Prior to this change I had confusing results from the test suite like
> "... is 22 (Invalid argument) but should be 0 (Invalid argument)".
> 
> Signed-off-by: Ed Maste <emaste at adaranet.com>

Applied to master and branch-1.[45678], thank you!



More information about the dev mailing list