[ovs-dev] [PATCH] bridge: Add controller status to Controller table.

Ben Pfaff blp at nicira.com
Mon Jan 24 05:27:42 UTC 2011


On Sun, Jan 23, 2011 at 8:55 PM, Andrew Evans <aevans at nicira.com> wrote:
>> It's probably a good idea to xstrdup() the return value of strerror()
>> here, because POSIX says "The string pointed to shall not be modified by
>> the application, but may be overwritten by a subsequent call to
>> strerror() [CX] [Option Start] or perror()."
>
> Huh. The pointer returned by strerror() used to just be the address of a
> constant string in an array of strings; i.e. read-only storage. Anyway,
> I'll copy it and free it later.

It's most commonly a constant string, but some implementations try to be
extra-helpful, e.g. if the argument is an invalid errno value they will
do something like sprintf(..., "Unknown error %d", error).

Thanks for the update, it looks OK to me now.




More information about the dev mailing list