From b96a57ff89d270b3711c964c379ec3ac272e503e Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 17 Jun 2009 10:37:33 +0200 Subject: [PATCH] Define missing ESTALE on Interix 3.5. --- ChangeLog | 10 ++++++++++ doc/posix-headers/errno.texi | 7 +++++-- lib/errno.in.h | 7 ++++++- lib/strerror.c | 8 +++++++- m4/errno_h.m4 | 5 ++++- 5 files changed, 32 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index e8ffc64c7..20a2ed5f1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2009-06-17 Bruno Haible + + Define missing ESTALE on Interix 3.5. + * lib/errno.in.h (ESTALE): Assign a value if missing. + * lib/strerror.c (rpl_strerror): Handle missing ESTALE and ECANCELED. + * m4/errno_h.m4 (gl_HEADER_ERRNO_H): Also test whether ESTALE is + missing. + * doc/posix-headers/errno.texi: Mention the Interix bug. + Reported by Jay Krell via Eric Blake. + 2009-06-15 Eric Blake memchr, memchr2: add valgrind exception diff --git a/doc/posix-headers/errno.texi b/doc/posix-headers/errno.texi index 7cec051d0..e0a98e3c0 100644 --- a/doc/posix-headers/errno.texi +++ b/doc/posix-headers/errno.texi @@ -19,14 +19,17 @@ The macros @code{ENOMSG}, @code{EIDRM}, @code{EPROTO}, @code{EBADMSG}, @code{ENOTSUP} are not defined on some platforms: OpenBSD 4.0, mingw. @item +The macro @code{ESTALE} is not defined on some platforms: +mingw, Interix 3.5. +@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}, @code{ESTALE}, -@code{EDQUOT} are not defined on some platforms: +@code{EHOSTUNREACH}, @code{EALREADY}, @code{EINPROGRESS}, @code{EDQUOT} are +not defined on some platforms: mingw. @end itemize diff --git a/lib/errno.in.h b/lib/errno.in.h index eef3931f9..3da0728ed 100644 --- a/lib/errno.in.h +++ b/lib/errno.in.h @@ -1,6 +1,6 @@ /* A POSIX-like . - Copyright (C) 2008 Free Software Foundation, Inc. + Copyright (C) 2008-2009 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -145,6 +145,11 @@ # define GNULIB_defined_ENOTSUP 1 # endif +# ifndef ESTALE +# define ESTALE 2009 +# define GNULIB_defined_ESTALE 1 +# endif + # ifndef ECANCELED # define ECANCELED 2008 # define GNULIB_defined_ECANCELED 1 diff --git a/lib/strerror.c b/lib/strerror.c index 798d85400..dfe6c25f2 100644 --- a/lib/strerror.c +++ b/lib/strerror.c @@ -313,7 +313,13 @@ rpl_strerror (int n) break; # endif -# if GNULIB_defined_ +# if GNULIB_defined_ESTALE + case ESTALE: + msg = "Stale NFS file handle"; + break; +# endif + +# if GNULIB_defined_ECANCELED case ECANCELED: msg = "Operation canceled"; break; diff --git a/m4/errno_h.m4 b/m4/errno_h.m4 index 16188d9bc..4ce1ccbd9 100644 --- a/m4/errno_h.m4 +++ b/m4/errno_h.m4 @@ -1,4 +1,4 @@ -# errno_h.m4 serial 5 +# errno_h.m4 serial 6 dnl Copyright (C) 2004, 2006, 2008, 2009 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,9 @@ booboo #if !defined ENOTSUP booboo #endif +#if !defined ESTALE +booboo +#endif #if !defined ECANCELED booboo #endif -- 2.11.0