]> Savannah Git Hosting - gnulib.git/commitdiff
Fix error when GNULIB_POSIXCHECK is enabled (regression 2019-06-04).
authorBruno Haible <bruno@clisp.org>
Wed, 18 Nov 2020 01:33:33 +0000 (02:33 +0100)
committerBruno Haible <bruno@clisp.org>
Wed, 18 Nov 2020 01:33:33 +0000 (02:33 +0100)
* lib/unistd.in.h (copy_file_range): Don't assume that copy_file_range
is always declared.
* m4/unistd_h.m4 (gl_UNISTD_H): Test whether copy_file_range is
declared.

ChangeLog
lib/unistd.in.h
m4/unistd_h.m4

index 5f14b87ea08bfd97d4a5aa53078240cf103eefbf..fcf2a3c1a458ab6a30b37f545d0ccd16d371e53e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2020-11-17  Bruno Haible  <bruno@clisp.org>
+
+       Fix error when GNULIB_POSIXCHECK is enabled (regression 2019-06-04).
+       * lib/unistd.in.h (copy_file_range): Don't assume that copy_file_range
+       is always declared.
+       * m4/unistd_h.m4 (gl_UNISTD_H): Test whether copy_file_range is
+       declared.
+
 2020-11-17  Bruno Haible  <bruno@clisp.org>
 
        Fix link errors on AIX.
index efe237fb2f4fc4e2a6124ee50e9198bcea3d046a..5cf6f9d2476498bb5c1f20c8e320063d7b99f872 100644 (file)
@@ -397,10 +397,11 @@ _GL_CXXALIAS_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos,
 # endif
 _GL_CXXALIASWARN (copy_file_range);
 #elif defined GNULIB_POSIXCHECK
-/* Assume copy_file_range is always declared.  */
+# if HAVE_RAW_DECL_COPY_FILE_RANGE
 _GL_WARN_ON_USE (copy_file_range,
                  "copy_file_range is unportable - "
                  "use gnulib module copy_file_range for portability");
+# endif
 #endif
 
 
index b4734daf603cf6e502c3b3d870aeba4d89713195..07b9158195f3d1992e0f3e131bf37c6f97c284ee 100644 (file)
@@ -1,4 +1,4 @@
-# unistd_h.m4 serial 81
+# unistd_h.m4 serial 82
 dnl Copyright (C) 2006-2020 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -41,7 +41,8 @@ AC_DEFUN([gl_UNISTD_H],
 #  include <io.h>
 # endif
 #endif
-    ]], [access chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir
+    ]], [access chdir chown copy_file_range dup dup2 dup3 environ euidaccess
+    faccessat fchdir
     fchownat fdatasync fsync ftruncate getcwd getdomainname getdtablesize
     getentropy getgroups gethostname getlogin getlogin_r getpagesize getpass
     getusershell setusershell endusershell