diff options
Diffstat (limited to 'lib/strerror_r.c')
-rw-r--r-- | lib/strerror_r.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/strerror_r.c b/lib/strerror_r.c index d0c7be953e..46b47ed8c1 100644 --- a/lib/strerror_r.c +++ b/lib/strerror_r.c @@ -209,9 +209,16 @@ strerror_r (int errnum, char *buf, size_t buflen) if (ret < 0) ret = errno; - /* FreeBSD rejects 0; see http://austingroupbugs.net/view.php?id=382. */ - if (errnum == 0 && ret == EINVAL) - ret = safe_copy (buf, buflen, "Success"); + /* FreeBSD rejects 0; see http://austingroupbugs.net/view.php?id=382. + MacOS X 10.5 strerror_r differs from the strerror string for 0. */ + if (errnum == 0) + { +# if defined __APPLE__ && defined __MACH__ + ret = EINVAL; +# endif + if (ret == EINVAL) + ret = safe_copy (buf, buflen, "Success"); + } #else /* USE_SYSTEM_STRERROR */ |