]> Savannah Git Hosting - gnulib.git/commitdiff
free-posix: port to GNU/Linux
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 19 Dec 2020 16:14:38 +0000 (08:14 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 19 Dec 2020 16:27:37 +0000 (08:27 -0800)
* m4/free.m4 (gl_FUNC_FREE): Don’t assume GNU hosts are free of
the bug, as it occurs on Ubuntu 20.10 x86-64 and, I assume, on
other GNU/Linux hosts.

ChangeLog
m4/free.m4

index 5a7bb6d59b203c9847f26efbc16efcb7860398a5..ef9ec28a488c95614a2f00c52884243b239ff219 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2020-12-19  Paul Eggert  <eggert@cs.ucla.edu>
+
+       free-posix: port to GNU/Linux
+       * m4/free.m4 (gl_FUNC_FREE): Don’t assume GNU hosts are free of
+       the bug, as it occurs on Ubuntu 20.10 x86-64 and, I assume, on
+       other GNU/Linux hosts.
+
 2020-12-19  Bruno Haible  <bruno@clisp.org>
 
        free-posix: Add tests.
index fb191df1e4eb0ce448cd2862d233910a6ec0ebb0..e7a72039e8656b180229e26c9d10f92827dbe881 100644 (file)
@@ -1,4 +1,4 @@
-# free.m4 serial 2
+# free.m4 serial 3
 # Copyright (C) 2003-2005, 2009-2020 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -9,7 +9,6 @@
 AC_DEFUN([gl_FUNC_FREE],
 [
   AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
-  AC_REQUIRE([AC_CANONICAL_HOST])
 
   dnl In the next release of POSIX, free must preserve errno.
   dnl https://www.austingroupbugs.net/view.php?id=385
@@ -19,21 +18,16 @@ AC_DEFUN([gl_FUNC_FREE],
   dnl whatever that happens to be.
   AC_CACHE_CHECK([whether free is known to preserve errno],
     [gl_cv_func_free_preserves_errno],
-    [case $host_os in
-       *-gnu* | gnu*)
-         gl_cv_func_free_preserves_errno=yes;;
-       *)
-         AC_COMPILE_IFELSE(
-           [AC_LANG_PROGRAM(
-              [[#include <unistd.h>
-              ]],
-              [[#if _POSIX_VERSION <= 200809
-                  #error "'free' is not known to preserve errno"
-                #endif
-              ]])],
-           [gl_cv_func_free_preserves_errno=yes],
-           [gl_cv_func_free_preserves_errno=no]);;
-     esac
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <unistd.h>
+          ]],
+          [[#if _POSIX_VERSION <= 200809
+              #error "'free' is not known to preserve errno"
+            #endif
+          ]])],
+       [gl_cv_func_free_preserves_errno=yes],
+       [gl_cv_func_free_preserves_errno=no])
     ])
 
   case $gl_cv_func_free_preserves_errno in