summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2015-02-18 23:20:55 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2015-02-18 23:21:18 -0800
commitf9fa7159134175033aa9fd52488de9f12ef1f6ff (patch)
treecf643bab55a9c30719d922aa8e245a5741ebdfed /m4
parent4ad02492559a3b95e0ab86d79dd0e0e611c0ac1d (diff)
downloadgnulib-f9fa7159134175033aa9fd52488de9f12ef1f6ff.tar.gz
dup2, fcntl: cross-compiler better for Android
Problem reported by Kevin Cernekee in: http://lists.gnu.org/archive/html/bug-gnulib/2015-02/msg00109.html * m4/dup2.m4 (gl_FUNC_DUP2): Don't guess no when cross-compiling for a Linux kernel. That kernel bug was fixed on 2009-05-11, and there's little need to cross-compile for older kernels nowadays. * m4/fcntl.m4 (gl_FUNC_FCNTL): When cross-compiling, guess no only for systems where the bug is known to occur (AIX, Cygwin, Haiku).
Diffstat (limited to 'm4')
-rw-r--r--m4/dup2.m45
-rw-r--r--m4/fcntl.m410
2 files changed, 6 insertions, 9 deletions
diff --git a/m4/dup2.m4 b/m4/dup2.m4
index fec42b0d5a..9aa2ea85eb 100644
--- a/m4/dup2.m4
+++ b/m4/dup2.m4
@@ -1,4 +1,4 @@
-#serial 21
+#serial 22
dnl Copyright (C) 2002, 2005, 2007, 2009-2015 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -64,9 +64,6 @@ AC_DEFUN([gl_FUNC_DUP2],
gl_cv_func_dup2_works="guessing no" ;;
cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0
gl_cv_func_dup2_works="guessing no" ;;
- linux*) # On linux between 2008-07-27 and 2009-05-11, dup2 of a
- # closed fd may yield -EBADF instead of -1 / errno=EBADF.
- gl_cv_func_dup2_works="guessing no" ;;
aix* | freebsd*)
# on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE,
# not EBADF.
diff --git a/m4/fcntl.m4 b/m4/fcntl.m4
index 1fce0f7e12..046ac5f7e9 100644
--- a/m4/fcntl.m4
+++ b/m4/fcntl.m4
@@ -1,4 +1,4 @@
-# fcntl.m4 serial 6
+# fcntl.m4 serial 7
dnl Copyright (C) 2009-2015 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -51,10 +51,10 @@ AC_DEFUN([gl_FUNC_FCNTL],
return result;]])],
[gl_cv_func_fcntl_f_dupfd_works=yes],
[gl_cv_func_fcntl_f_dupfd_works=no],
- [# Guess that it works on glibc systems
- case $host_os in #((
- *-gnu*) gl_cv_func_fcntl_f_dupfd_works="guessing yes";;
- *) gl_cv_func_fcntl_f_dupfd_works="guessing no";;
+ [case $host_os in
+ aix* | cygwin* | haiku*)
+ gl_cv_func_dup2_works="guessing no" ;;
+ *) gl_cv_func_dup2_works="guessing yes" ;;
esac])])
case $gl_cv_func_fcntl_f_dupfd_works in
*yes) ;;