]> Savannah Git Hosting - gnulib.git/commitdiff
dup2, fcntl: cross-compiler better for Android
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 19 Feb 2015 07:20:55 +0000 (23:20 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 19 Feb 2015 07:21:18 +0000 (23:21 -0800)
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).

ChangeLog
m4/dup2.m4
m4/fcntl.m4

index eacb80bd971dfe7b9183bbefa62dde9c46c2cb2f..53468afae26c3d5e199288e5e87ebe398c51dc05 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2015-02-18  Paul Eggert  <eggert@cs.ucla.edu>
+
+       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).
+
 2015-02-18  Pádraig Brady  <P@draigBrady.com>
 
        getopt: don't crash on memory exhaustion
index fec42b0d5a28cffe67440f02081e3d3d2b4955c8..9aa2ea85ebd0f47089aa4ad8c9a63636b53bb5fa 100644 (file)
@@ -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.
index 1fce0f7e1201aeeb1ea05a8f81f899699ac1c94f..046ac5f7e966702667a6955e52ff5114cf054590 100644 (file)
@@ -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) ;;