]> Savannah Git Hosting - gnulib.git/commitdiff
perror: Fix "perror clobbers strerror's buffer" problem on Android.
authorBruno Haible <bruno@clisp.org>
Wed, 11 Jan 2023 19:39:55 +0000 (20:39 +0100)
committerBruno Haible <bruno@clisp.org>
Wed, 11 Jan 2023 19:39:55 +0000 (20:39 +0100)
* m4/perror.m4 (gl_FUNC_PERROR): Set REPLACE_PERROR to 1 on Android.
* doc/posix-functions/perror.texi: Mention the Android problem.

ChangeLog
doc/posix-functions/perror.texi
m4/perror.m4

index 537b5526b76606a59ba73be422aad990b9a110c4..6374953ac68b58085804d09138a0b0906d03333d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-01-11  Bruno Haible  <bruno@clisp.org>
+
+       perror: Fix "perror clobbers strerror's buffer" problem on Android.
+       * m4/perror.m4 (gl_FUNC_PERROR): Set REPLACE_PERROR to 1 on Android.
+       * doc/posix-functions/perror.texi: Mention the Android problem.
+
 2023-01-11  Bruno Haible  <bruno@clisp.org>
 
        posix_spawn_file_actions_addfchdir tests: Fix test failure on Android.
index bbc2925d60651c94873e50e216bf7f1c00f52a82..4c4a7e36dde80de75a6f9dca6a612109ae8912c2 100644 (file)
@@ -18,7 +18,7 @@ requires that the message declare it as a success, on some platforms:
 FreeBSD 8.2, OpenBSD 4.7, macOS 11.1.
 @item
 This function clobbers the @code{strerror} buffer on some platforms:
-Cygwin 1.7.9.
+Cygwin 1.7.9, Android 11.
 @item
 This function fails to print a useful a string for out-of-range integers on
 some platforms:
index 3ff029de761f8417e21cfd48b13be5c0431dceb0..2545cb34873de516669215764a7a08ef5c1c01d9 100644 (file)
@@ -1,4 +1,4 @@
-# perror.m4 serial 10
+# perror.m4 serial 11
 dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -10,7 +10,7 @@ AC_DEFUN([gl_FUNC_PERROR],
   AC_REQUIRE([gl_HEADER_ERRNO_H])
   AC_REQUIRE([gl_FUNC_STRERROR_R])
   AC_REQUIRE([gl_FUNC_STRERROR_0])
-  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+  AC_REQUIRE([AC_CANONICAL_HOST])
   dnl We intentionally do not check for the broader REPLACE_STRERROR_R,
   dnl since on glibc systems, strerror_r is replaced only for signature
   dnl issues, and perror is just fine.  Rather, we only want to
@@ -68,4 +68,9 @@ AC_DEFUN([gl_FUNC_PERROR],
       REPLACE_PERROR=1
       ;;
   esac
+  dnl Does perror clobber the strerror buffer?
+  case "$host_os" in
+                     # Yes on Android 11.
+    linux*-android*) REPLACE_PERROR=1 ;;
+  esac
 ])