From c65167c86ed578b96c8466f2b006ef28a62c55c5 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Wed, 25 May 2011 21:05:11 +0000 Subject: [PATCH] * libc/string/strerror.c (_strerror_r): Report "Success" for 0. --- newlib/ChangeLog | 4 ++++ newlib/libc/string/strerror.c | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index cf900e453..82ca1a2f7 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,7 @@ +2011-05-25 Eric Blake + + * libc/string/strerror.c (_strerror_r): Report "Success" for 0. + 2011-05-25 Eric Blake * libc/string/strerror.c (strerror): Split body into... diff --git a/newlib/libc/string/strerror.c b/newlib/libc/string/strerror.c index fd6edd9e2..8852c36c7 100644 --- a/newlib/libc/string/strerror.c +++ b/newlib/libc/string/strerror.c @@ -33,6 +33,9 @@ This implementation of <> prints out the following strings for each of the values defined in `<>': o+ +o 0 +Success + o E2BIG Arg list too long @@ -361,6 +364,9 @@ _DEFUN (_strerror_r, (ptr, errnum, internal, errptr), switch (errnum) { + case 0: + error = "Success"; + break; /* go32 defines EPERM as EACCES */ #if defined (EPERM) && (!defined (EACCES) || (EPERM != EACCES)) case EPERM: