rubinius/rubinius — pull request #2365 by haines (2013-05-27 12:29:19+00:00)
Title: Wrap strerror_r to return the error message string

Follow-up for #2363. Although the fix in eca1ab8 solves the compile error, I'm not sure that ignoring the return value from `strerror_r` is the right approach.

GNU `strerror_r` returns a pointer to a string containing the error message, which may be the buffer passed as `buf`, or a pointer to an immutable static string, in which case `buf` is unused.

XSI `strerror_r` always stores the error message in `buf`, and returns an integer (0 for success).

See [`man strerror_r`](http://man7.org/linux/man-pages/man3/strerror.3.html) for full details.

This means that if the return value from the GNU-style `strerror_r` is just ignored, there will be problems in the case when `buf` is unused and a static string returned instead.

This modifies the `RBX_STRERROR` macro to match the GNU-style use of the function.