eina: fix behaviour break of eina_error_msg_get()
authorJean Guyomarc'h <jean.guyomarch@openwide.fr>
Mon, 29 Aug 2016 13:24:51 +0000 (15:24 +0200)
committerJean Guyomarc'h <jean@guyomarch.bzh>
Mon, 29 Aug 2016 18:03:52 +0000 (20:03 +0200)
commit3f79cf87485bd25a1ae958a18c27266af1b36272
tree5938698df418bfa8cc63fcfd6ba7bf5c9c6d41d8
parent3791ed5fe02d9f330e1b981c53ae169f6fdb271f
eina: fix behaviour break of eina_error_msg_get()

eina_error_msg_get() must return NULL if an incorrect error is provided.
The XSI strerror_r() returns EINVAL when an invalid error is passed to
it, so we can end the function here. If we kept on, we would have tested
against the 'unknown_prefix' ("Unknown error ") which is implementation
defined, and registered a new error when the invalid error message
didn't match the 'unknown_prefix'. This new error message would have
been returned, which is not what we expected.

This case arised on Mac OS X where the 'unkwown prefix' is
"Unknown error: " instead of "Unknown error ".

It fixes eina test suite on Mac OS X.
src/lib/eina/eina_error.c