[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] strsignal: work around NetBSD bug
From: |
Eric Blake |
Subject: |
[PATCH] strsignal: work around NetBSD bug |
Date: |
Thu, 9 Sep 2010 17:28:22 -0600 |
* m4/strsignal.m4 (gl_FUNC_STRSIGNAL): Also check in <unistd.h>.
* lib/string.in.h (includes): Likewise.
* doc/posix-functions/strsignal.texi (strsignal): Document the
bug.
Reported by Nelson H. F. Beebe.
Signed-off-by: Eric Blake <address@hidden>
---
Tested on NetBSD 5.0, and resolves the issue.
ChangeLog | 9 +++++++++
doc/posix-functions/strsignal.texi | 5 +++++
lib/string.in.h | 6 ++++++
m4/strsignal.m4 | 3 ++-
4 files changed, 22 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 63214de..6c2d21b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2010-09-09 Eric Blake <address@hidden>
+ strsignal: work around NetBSD bug
+ * m4/strsignal.m4 (gl_FUNC_STRSIGNAL): Also check in <unistd.h>.
+ * lib/string.in.h (includes): Likewise.
+ * doc/posix-functions/strsignal.texi (strsignal): Document the
+ bug.
+ Reported by Nelson H. F. Beebe.
+
gnulib-tool: work with NetBSD /bin/sh
* gnulib-tool (func_cache_var, func_cache_lookup_module)
(func_get_description, func_get_comment, func_get_status)
diff --git a/doc/posix-functions/strsignal.texi
b/doc/posix-functions/strsignal.texi
index 1d48543..51b1d00 100644
--- a/doc/posix-functions/strsignal.texi
+++ b/doc/posix-functions/strsignal.texi
@@ -16,6 +16,11 @@ strsignal
This function does not return a string for out-of-range numbers on
some platforms:
Solaris, AIX 5.1.
+
address@hidden
+This function is declared in @code{unistd.h} instead of
address@hidden on some platforms:
+NetBSD 5.0.
@end itemize
Portability problems not fixed by Gnulib:
diff --git a/lib/string.in.h b/lib/string.in.h
index db4c4aa..5409f31 100644
--- a/lib/string.in.h
+++ b/lib/string.in.h
@@ -49,6 +49,12 @@
# define _GL_ATTRIBUTE_PURE /* empty */
#endif
+/* NetBSD 5.0 declares strsignal in <unistd.h>, not in <string.h>. */
+/* But avoid namespace pollution on glibc systems. */
+#if (@GNULIB_STRSIGNAL@ || defined GNULIB_POSIXCHECK) \
+ && ! defined __GLIBC__
+# include <unistd.h>
+#endif
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
diff --git a/m4/strsignal.m4 b/m4/strsignal.m4
index be3c733..6cb8d9d 100644
--- a/m4/strsignal.m4
+++ b/m4/strsignal.m4
@@ -1,4 +1,4 @@
-# strsignal.m4 serial 3
+# strsignal.m4 serial 4
dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -26,6 +26,7 @@ AC_DEFUN([gl_FUNC_STRSIGNAL],
[AC_RUN_IFELSE(
[AC_LANG_PROGRAM(
[[#include <string.h>
+#include <unistd.h> /* NetBSD 5.0 declares it in wrong header. */
]],
[[char *s = strsignal (-1);
return !(s != (char *) 0 && s != (char *) -1);]])],
--
1.7.2.2