bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/2] strerror_r: fix OpenBSD behavior on 0


From: Bruno Haible
Subject: Re: [PATCH 1/2] strerror_r: fix OpenBSD behavior on 0
Date: Fri, 24 Jun 2011 11:26:26 +0200
User-agent: KMail/1.9.9

Eric Blake wrote:
> --- a/lib/strerror-override.c
> +++ b/lib/strerror-override.c
> @@ -37,6 +37,11 @@ strerror_override (int errnum)
>    /* These error messages are taken from glibc/sysdeps/gnu/errlist.c.  */
>    switch (errnum)
>      {
> +#if REPLACE_STRERROR_0
> +    case 0:
> +      return "Success";
> +#endif
> +
>  #if GNULIB_defined_ETXTBSY
>      case ETXTBSY:
>        return "Text file busy";
> diff --git a/lib/strerror-override.h b/lib/strerror-override.h
> index b8ef854..cab0196 100644
> --- a/lib/strerror-override.h
> +++ b/lib/strerror-override.h
> @@ -40,7 +40,8 @@
>      || GNULIB_defined_ENOTSUP \
>      || GNULIB_defined_ESTALE \
>      || GNULIB_defined_EDQUOT \
> -    || GNULIB_defined_ECANCELED
> +    || GNULIB_defined_ECANCELED \
> +    || REPLACE_STRERROR_0
>  extern const char *strerror_override (int errnum);

Thanks. Only a small tweak: If REPLACE_STRERROR_0 is added at the beginning
in one file, it is only consistent to add it at the beginning in the other file
as well.


2011-06-24  Bruno Haible  <address@hidden>

        strerror-override: No-op tweak.
        * lib/strerror-override.h (strerror_override): Reorder conditions,
        for consistency with lib/strerror-override.c.

--- lib/strerror-override.h.orig        Fri Jun 24 11:21:11 2011
+++ lib/strerror-override.h     Fri Jun 24 11:20:53 2011
@@ -28,20 +28,20 @@
 
 /* If ERRNUM maps to an errno value defined by gnulib, return a string
    describing the error.  Otherwise return NULL.  */
-# if GNULIB_defined_ETXTBSY \
-    || GNULIB_defined_ESOCK \
-    || GNULIB_defined_ENOMSG \
-    || GNULIB_defined_EIDRM \
-    || GNULIB_defined_ENOLINK \
-    || GNULIB_defined_EPROTO \
-    || GNULIB_defined_EMULTIHOP \
-    || GNULIB_defined_EBADMSG \
-    || GNULIB_defined_EOVERFLOW \
-    || GNULIB_defined_ENOTSUP \
-    || GNULIB_defined_ESTALE \
-    || GNULIB_defined_EDQUOT \
-    || GNULIB_defined_ECANCELED \
-    || REPLACE_STRERROR_0
+# if REPLACE_STRERROR_0 \
+     || GNULIB_defined_ETXTBSY \
+     || GNULIB_defined_ESOCK \
+     || GNULIB_defined_ENOMSG \
+     || GNULIB_defined_EIDRM \
+     || GNULIB_defined_ENOLINK \
+     || GNULIB_defined_EPROTO \
+     || GNULIB_defined_EMULTIHOP \
+     || GNULIB_defined_EBADMSG \
+     || GNULIB_defined_EOVERFLOW \
+     || GNULIB_defined_ENOTSUP \
+     || GNULIB_defined_ESTALE \
+     || GNULIB_defined_EDQUOT \
+     || GNULIB_defined_ECANCELED
 extern const char *strerror_override (int errnum);
 # else
 #  define strerror_override(ignored) NULL

-- 
In memoriam Walther Rathenau <http://en.wikipedia.org/wiki/Walther_Rathenau>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]