Blame SOURCES/autofs-5.1.3-update-configure-to-check-for-pipe2.patch

603f99
commit f103a48636a7979c68c7a64cb381a4d0942c5109
603f99
Author: Ian Kent <raven@themaw.net>
603f99
Date:   Mon Nov 13 09:48:39 2017 +0800
603f99
603f99
    autofs-5.1.3 - update configure to check for pipe2(2)
603f99
    
603f99
    In a bug report by John Salmon it appears that the use of __have_pipe2
603f99
    isn't doing what's needed when checking for pipe2(2).
603f99
    
603f99
    Hopefully updating configure to explicity check for pipe2(2), lifted
603f99
    from John's patch, will be more reliable.
603f99
    
603f99
    Signed-off-by: Ian Kent <raven@themaw.net>
603f99
603f99
---
603f99
 CHANGELOG           |    1 +
603f99
 configure           |   12 ++++++++++++
603f99
 configure.in        |    2 ++
603f99
 include/automount.h |    2 +-
603f99
 include/config.h.in |    3 +++
603f99
 5 files changed, 19 insertions(+), 1 deletion(-)
603f99
603f99
--- autofs-5.0.7.orig/CHANGELOG
603f99
+++ autofs-5.0.7/CHANGELOG
603f99
@@ -285,6 +285,7 @@
603f99
 - fix memory leak in umount_amd_ext_mount().
603f99
 - fix strerror_r() parameter declaration in do program_mount().
603f99
 - fix incorrect check in validate_program_options().
603f99
+- update configure to check for pipe2(2).
603f99
 
603f99
 25/07/2012 autofs-5.0.7
603f99
 =======================
603f99
--- autofs-5.0.7.orig/configure.in
603f99
+++ autofs-5.0.7/configure.in
603f99
@@ -153,6 +153,8 @@ AF_CHECK_SSS_LIB(SSS_AUTOFS, libsss_auto
603f99
 AC_SUBST(HAVE_SSS_AUTOFS)
603f99
 AC_SUBST(sssldir)
603f99
 
603f99
+AC_CHECK_FUNCS(pipe2)
603f99
+
603f99
 #
603f99
 # Newer mounts have the -s (sloppy) option to ignore unknown options,
603f99
 # good for portability
603f99
--- autofs-5.0.7.orig/include/automount.h
603f99
+++ autofs-5.0.7/include/automount.h
603f99
@@ -653,7 +653,7 @@ static inline int open_pipe(int pipefd[2
603f99
 {
603f99
 	int ret;
603f99
 
603f99
-#if defined(O_CLOEXEC) && defined(SOCK_CLOEXEC) && defined(__have_pipe2)
603f99
+#if defined(O_CLOEXEC) && defined(SOCK_CLOEXEC) && defined(HAVE_PIPE2)
603f99
 	if (cloexec_works != -1) {
603f99
 		ret = pipe2(pipefd, O_CLOEXEC);
603f99
 		if (ret != -1)
603f99
--- autofs-5.0.7.orig/include/config.h.in
603f99
+++ autofs-5.0.7/include/config.h.in
603f99
@@ -54,6 +54,9 @@
603f99
 /* define if you have MOUNT_NFS */
603f99
 #undef HAVE_MOUNT_NFS
603f99
 
603f99
+/* Define to 1 if you have the `pipe2' function. */
603f99
+#undef HAVE_PIPE2
603f99
+
603f99
 /* define if the mount command supports the -s option */
603f99
 #undef HAVE_SLOPPY_MOUNT
603f99
 
603f99
--- autofs-5.0.7.orig/configure
603f99
+++ autofs-5.0.7/configure
603f99
@@ -3955,6 +3955,18 @@ fi
603f99
 
603f99
 
603f99
 
603f99
+for ac_func in pipe2
603f99
+do :
603f99
+  ac_fn_c_check_func "$LINENO" "pipe2" "ac_cv_func_pipe2"
603f99
+if test "x$ac_cv_func_pipe2" = xyes; then :
603f99
+  cat >>confdefs.h <<_ACEOF
603f99
+#define HAVE_PIPE2 1
603f99
+_ACEOF
603f99
+
603f99
+fi
603f99
+done
603f99
+
603f99
+
603f99
 #
603f99
 # Newer mounts have the -s (sloppy) option to ignore unknown options,
603f99
 # good for portability