Avoid implementation-defined strerror behaviour
authorEd Maste <emaste@adaranet.com>
Fri, 27 Jul 2012 21:27:15 +0000 (17:27 -0400)
committerBen Pfaff <blp@nicira.com>
Fri, 27 Jul 2012 21:30:24 +0000 (14:30 -0700)
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@adaranet.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>

No differences found