From: Bruno Haible Date: Sun, 31 Jul 2011 17:00:23 +0000 (+0200) Subject: errno: Port to Minix. X-Git-Tag: v0.1~2042 X-Git-Url: http://erislabs.net/gitweb/?p=gnulib.git;a=commitdiff_plain;h=712cf13da004184edfac5a715118fe77bd257f1c errno: Port to Minix. * m4/errno_h.m4 (gl_HEADER_ERRNO_H): Test also whether ENETRESET and ECONNABORTED are defined. * lib/errno.in.h (ENETRESET, GNULIB_defined_ENETRESET, ECONNABORTED, GNULIB_defined_ECONNABORTED): New macros. * lib/strerror-override.h (strerror_override): Test also GNULIB_defined_ENETRESET, GNULIB_defined_ECONNABORTED. * lib/strerror-override.c (strerror_override): Handle also ENETRESET, ECONNABORTED. * doc/posix-headers/errno.texi: Mention the Minix problem. --- diff --git a/ChangeLog b/ChangeLog index f41fb6534..31952bbd0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,18 @@ 2011-07-31 Bruno Haible + errno: Port to Minix. + * m4/errno_h.m4 (gl_HEADER_ERRNO_H): Test also whether ENETRESET and + ECONNABORTED are defined. + * lib/errno.in.h (ENETRESET, GNULIB_defined_ENETRESET, ECONNABORTED, + GNULIB_defined_ECONNABORTED): New macros. + * lib/strerror-override.h (strerror_override): Test also + GNULIB_defined_ENETRESET, GNULIB_defined_ECONNABORTED. + * lib/strerror-override.c (strerror_override): Handle also ENETRESET, + ECONNABORTED. + * doc/posix-headers/errno.texi: Mention the Minix problem. + +2011-07-31 Bruno Haible + Work around declaration collisions on Minix. * m4/mbsinit.m4 (gl_FUNC_MBSINIT): If mbsinit is declared but not defined, set REPLACE_MBSINIT. diff --git a/doc/posix-headers/errno.texi b/doc/posix-headers/errno.texi index eb1623dc7..9247797bb 100644 --- a/doc/posix-headers/errno.texi +++ b/doc/posix-headers/errno.texi @@ -25,14 +25,17 @@ mingw, Interix 3.5. The macro @code{EDQUOT} is not defined on some platforms: NonStop Kernel, mingw. @item +The macros @code{ENETRESET}, @code{ECONNABORTED} are not defined on some +platforms: +Minix 3.1.8, mingw. +@item The macros @code{EWOULDBLOCK}, @code{ETXTBSY}, @code{ELOOP}, @code{ENOTSOCK}, @code{EDESTADDRREQ}, @code{EMSGSIZE}, @code{EPROTOTYPE}, @code{ENOPROTOOPT}, @code{EPROTONOSUPPORT}, @code{EOPNOTSUPP}, @code{EAFNOSUPPORT}, @code{EADDRINUSE}, @code{EADDRNOTAVAIL}, @code{ENETDOWN}, @code{ENETUNREACH}, -@code{ENETRESET}, @code{ECONNABORTED}, @code{ECONNRESET}, @code{ENOBUFS}, -@code{EISCONN}, @code{ENOTCONN}, @code{ETIMEDOUT}, @code{ECONNREFUSED}, -@code{EHOSTUNREACH}, @code{EALREADY}, @code{EINPROGRESS} are not defined on -some platforms: +@code{ECONNRESET}, @code{ENOBUFS}, @code{EISCONN}, @code{ENOTCONN}, +@code{ETIMEDOUT}, @code{ECONNREFUSED}, @code{EHOSTUNREACH}, @code{EALREADY}, +@code{EINPROGRESS} are not defined on some platforms: mingw. @end itemize diff --git a/lib/errno.in.h b/lib/errno.in.h index c413d183b..0bf579211 100644 --- a/lib/errno.in.h +++ b/lib/errno.in.h @@ -147,6 +147,16 @@ # define GNULIB_defined_ENOTSUP 1 # endif +# ifndef ENETRESET +# define ENETRESET 2011 +# define GNULIB_defined_ENETRESET 1 +# endif + +# ifndef ECONNABORTED +# define ECONNABORTED 2012 +# define GNULIB_defined_ECONNABORTED 1 +# endif + # ifndef ESTALE # define ESTALE 2009 # define GNULIB_defined_ESTALE 1 diff --git a/lib/strerror-override.c b/lib/strerror-override.c index e10317314..d6ecf2eca 100644 --- a/lib/strerror-override.c +++ b/lib/strerror-override.c @@ -248,6 +248,16 @@ strerror_override (int errnum) return "Not supported"; #endif +#if GNULIB_defined_ENETRESET + case ENETRESET: + return "Network dropped connection on reset"; +#endif + +#if GNULIB_defined_ECONNABORTED + case ECONNABORTED: + return "Software caused connection abort"; +#endif + #if GNULIB_defined_ESTALE case ESTALE: return "Stale NFS file handle"; diff --git a/lib/strerror-override.h b/lib/strerror-override.h index a26e11ad0..81e4a5075 100644 --- a/lib/strerror-override.h +++ b/lib/strerror-override.h @@ -39,6 +39,8 @@ || GNULIB_defined_EBADMSG \ || GNULIB_defined_EOVERFLOW \ || GNULIB_defined_ENOTSUP \ + || GNULIB_defined_ENETRESET \ + || GNULIB_defined_ECONNABORTED \ || GNULIB_defined_ESTALE \ || GNULIB_defined_EDQUOT \ || GNULIB_defined_ECANCELED diff --git a/m4/errno_h.m4 b/m4/errno_h.m4 index a6d37f3b3..560adbafe 100644 --- a/m4/errno_h.m4 +++ b/m4/errno_h.m4 @@ -1,4 +1,4 @@ -# errno_h.m4 serial 9 +# errno_h.m4 serial 10 dnl Copyright (C) 2004, 2006, 2008-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -34,6 +34,12 @@ booboo #if !defined ENOTSUP booboo #endif +#if !defined ENETRESET +booboo +#endif +#if !defined ECONNABORTED +booboo +#endif #if !defined ESTALE booboo #endif